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.
|PSG team-mate Choupo-Moting hopes Neymar injury is not serious|
|McLeish marvels at stylish Scotland´s promotion success|
|Draw proves Poland can play well without Lewandowski – Brzeczek|
|Giggs: Wales let themselves down|
|Sarachan ´moved USA forward´ in interim spell|
|Mickelson lays $200,000 bet with Woods for first hole|
|Dolphins QB Tannehill to start against Colts|
|Murcia edge out Banvit, Bonn crush Opava|
|Neymar injury not serious, says doctor|
|Mancini: Italy ahead of schedule|
|France 1 Uruguay 0: Giroud hits the spot after Mbappe injury blow|
|Portugal 1 Poland 1: Milik penalty salvages precious point as Danilo sees red|
|Italy 1 United States 0: Politano snatches late winner for Mancini´s men|
|Scotland 3 Israel 2: Forrest hat-trick seals Nations League promotion|
|Brazil 1 Cameroon 0: Richarlison fills Neymar´s boots as skipper suffers injury|
|France & PSG star Mbappe suffers shoulder injury|
|Albania 1 Wales 0: Gunter´s night spoiled by Balaj|
|Leeds and Manchester United to meet in friendly|
|Outspoken Smith leaves Cavaliers|
|PSG star Neymar injured for Brazil|
|Juventus midfielder Can back in training after surgery|
|Rams-Chiefs rollercoaster was the NFL´s modern-day masterpiece|
|Ronaldo an AC Milan target in 2017, confirms Fassone|
|Farah could get back on track at Tokyo Olympics|
|PSG still waiting on Alves and Kurzawa|
|Atalanta reject Gasperini to AC Milan speculation|
|Edmonton Oilers name Hitchcock new head coach|
|JR Smith on Cleveland Cavaliers: Tanking ´was always the plan´|
|Chester signs new Wakefield deal|
|F1 Raceweek: Countdown on to Alonso farewell|
|Rain disrupts Lorenzo´s Honda debut|
|VAR a possibility for Champions League knockout rounds|
|FFP vulnerable in areas, says UEFA president Ceferin|
|Sri Lanka draft in uncapped Peiris to replace Dananjaya|
|Coman back in Bayern training but Lewandowski has knee injury|
|Qalandars land De Villiers in PSL draft, Smith second pick|
|F1 changes helped less talented drivers on the grid - Alonso|
|Agnelli: No super league talks since 2015|
|I hope from now on it only gets better - Floersch update on horror crash|
|Calf injury rules Ashton out of Australia match|
|Halfpenny to miss South Africa clash|
|Hard for Lazio to hold on to Milinkovic-Savic, says Lotito|
|Australia´s next generation pay tribute to retiring Cahill|
|Bairstow pushing hard for Test recall|
|Cane eyes 2019 Super Rugby return after neck break|
|Van Dijk finds time to console referee during Dutch delight|
|Cahill sheds tear at end of phenomenal Australia career|
|WATCH: Pelicans coach Gentry interviews himself|
|Where does Chiefs-Rams classic rank among NFL´s highest-scoring matches?|
|Australia 3 Lebanon 0: Boyle bags brace on Cahill farewell|
|Guendouzi underlines desire to represent France|
|I might need a couple of drinks to relax after that! - Rams coach McVay|
|Juventus´ Alex Sandro has Premier League ambition|
|Ederson taking goalkeeping to another level, says City hero Weaver|
|Ceferin dismisses "super league" plans as fiction|
|Rams defeat Chiefs in one of the highest scoring games in NFL history|
|Kemba Walker leads Hornets to win over Celtics|
|Gomez praises ´top player´ Van Dijk, Stones|
|Cricket Australia to maintain Smith, Warner ball tampering bans|
|Brazil´s Tite encouraged by Neymar captaincy|
|Holmes set for NFL switch after Cronulla release|
|Dier encourages English youngsters to follow Sancho´s lead|
|Southgate promises further changes to England squad|
|Jones sceptical over Pocock injury|
|Sane encouraged despite Germany´s ´annoying´ Nations League draw|
|Character got Netherlands through, says Koeman|
|Netherlands´ focus still on Euros - Van Dijk|
|Ireland will be ready for qualifiers, insists O´Neill|
|Smith undergoes successful surgery, Redskins sign Sanchez|
|Germany 2 Netherlands 2: Dramatic five-minute fightback seals Oranje progression|