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.
|Neymar in line for PSG return versus Monaco|
|Azema signs new Clermont contract until 2023|
|Falcao: I´ve got years left at top level|
|Crawford aims to state pound-for-pound case against Khan|
|How Emery´s numbers compare to Arsenal predecessor Wenger|
|Hendricks leads Cubs to fourth straight win|
|MLS Review: Ibrahimovic, Galaxy continue fine form|
|Raptors hold off Magic, Celtics extend lead over Pacers|
|Valverde wary of ´powerful´ Liverpool|
|Raptors star Leonard played through sickness against Magic|
|Djokovic upbeat over French Open chances despite form dip|
|Zaha hints at Palace exit, eyes Champions League|
|I messed up – Miller speaks out after second failed test|
|Johnson continues good form, Lowry leads|
|DeGrom to undergo MRI for elbow ailment|
|Guardiola is world´s best coach – Valverde|
|Klopp: Liverpool still embracing pressure|
|Medvedev masters Djokovic as Fognini fights back in style|
|Guardiola defends tactics after Man City´s Champions League exit|
|Guardiola: VAR is ´f****** boring to talk about´|
|Norwich City 2 Sheffield Wednesday 2: Late Vrancic stunner secures point for Canaries|
|Kohli hits century as Challengers survive Russell onslaught|
|Miller out of Joshua fight after second failed test, says promoter Hearn|
|Hennessey ´desperate´ to be educated about Hitler and Nazism - Hodgson|
|Spurs are amazing! – Ajax boss Ten Hag relishing Tottenham test|
|Nadal passes Pella test to remain on track in Monte Carlo|
|Championship Review: Ten-man Latics dent Leeds´ promotion push, Bolton relegated|
|Juventus goalkeeper Perin has shoulder surgery|
|We always expect something special from Messi – Valverde|
|The O-Line bond behind two Heisman Trophies - Dru Samia & Ben Powers talk protecting Baker Mayfield|
|Super Saints thrash sorry Wigan as Leeds Rhinos climb off the bottom|
|Ramsey could return in two weeks, says Emery|
|Valverde surprised by Coutinho controversy|
|Sexton, Mako Vunipola return for European Champions Cup|
|Under-strength Hurricanes survive Sunwolves scare|
|Lingard admits top-four finish would be ´massive´ for Manchester United|
|Icardi planning Inter stay - agent Wanda Nara|
|Impossible to recreate Ajax model in Serie A – Spalletti|
|Elijah Holyfield set for NFL armed with fatherly advice and Georgia grounding|
|Guardiola ´delighted´ for Ajax boss Ten Hag|
|He can be an important player for us - Gattuso leaves door open for Silva|
|Medvedev stuns Djokovic to continue dream Monte Carlo run|
|Guardiola: Referees can still make mistakes with VAR|
|Te´o to depart Worcester Warriors amid rumours of Top 14 move|
|Odriozola suffers broken collarbone|
|Sheffield United 2 Nottingham Forest 0: Duffy sends Blades second|
|I really felt for them – Klopp sympathises with Manchester City´s VAR heartbreak|
|Champions League exit no title race advantage for Man City, says Guardiola|
|Mitchell magic seals golden-point win for Roosters|
|Kante: Chelsea not favourites for Europa League|
|Adelaide United 1 Melbourne Victory 0: Blackwood header snatches victory|
|Klopp applauds ´role model´ Salah after making Time magazine cover|
|Fabregas suffers calf injury ahead of PSG clash|
|Ronaldo is the future of Juventus - Allegri defends star after Champions League exit|
|Simeone: Costa issue is resolved|
|Khan always believed big nights would return as Crawford looms into view|
|Liverpool and Manchester City are miles ahead of the rest - Warnock|
|Wilder: Joshua fight is inevitable|
|There´s no other player like him - Rivaldo tips Messi for Ballon d´Or|
|Malone urges Nuggets response to ´hungry´ White|
|Fosu-Mensah returns to Man United from Fulham for knee surgery|
|Solskjaer claims some Manchester United stars ´need a reality check´|
|Brown lauds exceptional Simmons after Sixers take series lead|
|Maitland-Niles buoyed by Emery´s belief in Arsenal stars|
|Durant showed who he is – Kerr|
|Giroud will stay at Chelsea, insists Sarri|
|The big Friday Premier League quiz|
|Dodgers hold off Brewers|
|76ers win without Embiid, Warriors bounce back in big way|
|Knicks confident they will appeal to stars|