Ireland's historic Test debut ended in a five-wicket defeat, but only after they had given Pakistan a major scare on the final day at Malahide.
The tourists ultimately prevailed with a degree of comfort, reaching a target of 160 thanks largely to Imam-ul-Haq's unbeaten 74 and 59 from Babar Azam.
However, Pakistan had crumbled to 14-3 in Tuesday's morning session, raising the prospect of a stunning Ireland victory after the hosts had been made to follow on.
Mohammad Abbas finished with a five-for and match figures of 9-110 as Ireland were dismissed for 339 having resumed on 319-7, the dangerous Kevin O'Brien failing to add to his overnight score of 118.
Pakistan's subsequent wobble left the match fascinatingly poised, but Imam and Babar restored order and the chase was completed before tea, allowing Pakistan to look ahead to facing England, while Ireland reflect on a promising first venture into the Test arena.
Pakistan have won by 5 wickets. We may not have got the win, but it was a fantastic effort from every one of our team on a historic occasion. They’ve done us proud.— Cricket Ireland (@Irelandcricket) May 15, 2018
Thank you @TheRealPCB for a fantastic Test match.#IREvPAK #BackingGreen pic.twitter.com/9cSBRpOKk7
O'Brien's hundred, which will go down in the history books as his country's first in this format, kept Ireland alive on day four, but he departed to the first ball he faced on Tuesday, edging Abbas to Haris Sohail at slip.
Abbas swiftly removed Boyd Rankin (6) and Tyrone Kane (14) to return second-innings figures of 5-66.
Ireland fought back superbly, though, taking three quick wickets to bring the contest to life.
Tim Murtagh had Azhar Ali (2) caught at first slip and bowled Asad Shafiq (1), either side of Sohail (7) departing to an excellent Ed Joyce catch in the gully off Rankin.
However, debutant Imam and Babar maintained their composure to combine for 38 runs before lunch and their alliance continued well into the afternoon after the latter was dropped by Andrew Balbirnie off Murtagh on nine.
Babar was eventually run out by Balbirnie and Pakistan captain Sarfraz Ahmed (8) fell lbw to Stuart Thompson, but the second Ireland rally came too late and top-scorer Imam fittingly contributed the winning runs.
|DeGrom strikes out 12, Mets hit 5 homers in win over Yankees|
|Djokovic needs nine MPs as Murray crashes out|
|Murray unsure of US Open readiness after Cincinnati exit|
|Van Dijk: Alisson making difference at Liverpool|
|Johnson saves eight MPs but Djokovic prevails|
|Federer anxious ahead of Cincinnati comeback|
|Tevez relishing Messi reunion|
|Ronaldo arrival has taken Juve forward in Europe – Nedved|
|Serena steamrolls Gavrilova in Cincinnati return|
|Packers QB Rodgers doesn´t regret criticising team-mates|
|Indians OF Martin recovering from life-threatening bacterial infection|
|Shoulder injury sends Royals starter Duffy to DL|
|Yankees place Sabathia on DL with right knee inflammation|
|Aubameyang urges Emery to capitalise on his ´spark´ with Lacazette|
|Anderson can play until he´s 40, says Bayliss|
|Keita living childhood dream after securing Inter switch|
|49ers to sign veteran RB Alfred Morris, Kyle Shanahan says|
|Arnaiz leaves Barcelona for Leganes in €5m deal|
|Tottenham´s move to new stadium delayed|
|Roosters-bound Hall suffers ACL injury|
|Murray suffers Cincinnati defeat to Pouille|
|No Cech mate - Arsenal goalkeeper hits back at Bayer Leverkusen|
|Halep first to seal WTA Finals spot|
|Veteran Carmelo Anthony pens one-year Rockets deal|
|Runners and Ryders: Poulter closes in on Team Europe spot|
|Gameiro presented by Valencia after departing Atletico Madrid|
|World Cup winner Kimpembe extends PSG contract to 2023|
|AC Milan send Locatelli on loan to Sassuolo|
|South Africa´s Etzebeth set for return from injury|
|Rafinha ´very likely´ to stay at Barcelona|
|No dual Ryder Cup role should Woods make USA team, says Furyk|
|Inter complete Keita deal|
|David Silva announces retirement from international football|
|Modric in Real Madrid´s UEFA Super Cup squad amid Inter links|
|Neville hopes Shaw is on to something special after first United goal|
|Unchanged England waiting on Stokes verdict|
|Yates brothers to race Vuelta together|
|Kalinic explains why he rejected World Cup medal|
|Furyk excited to see Woods´ return to form|
|Liverpool ignoring media´s champions chat, says Van Dijk|
|Suspended Smith replaces Kohli as top-ranked Test batsman|
|Tiger fanfare inevitable but it´s time to recognise Koepka as the star he is|
|Dier: Tottenham will shut up transfer critics|
|Fernandes leaves West Ham for Fiorentina on loan|
|´No chance´ Willian would have stayed at Chelsea under Conte|
|Vettel confident he can catch Hamilton|
|Cane dismisses talk of All Blacks limiting haka|
|Zaha promises Palace commitment as contract talks continue|
|Real Madrid defender Odriozola to miss UEFA Super Cup|
|All Blacks wary of Pocock threat|
|Bayern Munich confirm no ligament damage for Alaba|
|Nicklaus hails Koepka´s great year after US PGA triumph|
|Keita ready to ´explode´ at Inter|
|Halep: Stephens makes me a better player|
|Manchester United loan Wilson to Aberdeen|
|Beale backs Hodge to start in Rugby Championship opener|
|Bakayoko arrives for AC Milan medical|
|Australia favourites for Rugby Championship opener, says Hansen|
|Muller hails Lewandowski: That´s why Bayern won´t let him go|
|Allegri eyes Champions League after watching Ronaldo score first Juventus goal|
|LaLiga 2018-19: Barcelona or Real Madrid - whose close-season transfers have been better?|
|Fekir almost certain to stay at Lyon, says Aulas|
|Tuchel unaware of PSG deal for Kehrer|
|MLS Review: Rooney´s heroics lift DC, Villa inspires NYC|
|Sale strikes out 12 in Red Sox´s win over Orioles|
|Scott buoyed by Bellerive display|
|Edmund, Mannarino win Cincinnati openers|
|WATCH: Rooney saves open goal before setting up last-gasp winner|
|Kovac praises three-goal Lewandowski but thanks Heynckes|
|Nadal withdraws from Cincinnati Masters|