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.
|Bielsa´s Derby County dossier detail ´pretty standard´ – OptaPro chief|
|Injury-hit Madrid lose Navas to adductor issue|
|Patriots coach Belichick still gets nervous ´every week´|
|Copa del Rey draw: Barcelona to meet Sevilla in quarter-finals|
|Kohli: No one more committed to India than Dhoni|
|Brook questions Khan credibility following Crawford agreement|
|Sad Pochettino admits Bielsa is ´wrong´|
|Simeone eyes LaLiga gain after Atletico´s Copa del Rey pain|
|Rossi a no-go for Tottenham as Pochettino rules out panic buys|
|Guardiola identifies ´three or four´ midfield targets|
|Nadal encourages patience in young stars after humbling De Minaur|
|NFL playoffs 2019: 10 Opta facts for Patriots v Chiefs|
|Robertson helping Klopp learn Scottish for Dalglish chats|
|Levante appeal over alleged ineligible Barcelona player rejected|
|NFL Playoffs 2019: 10 Opta facts for Rams v Saints|
|Lowry to take three-shot Abu Dhabi lead into final round|
|Training is not for anyone else - Klopp condemns Bielsa over ´spygate´ row|
|In other countries, everybody does it - Guardiola respect remains for spying Bielsa|
|Cilic battles back to join Nadal, Federer in fourth round|
|Klopp: Trent unbelievable for playing through pain|
|Faulkner provides super start and fabulous finish to sink Scorchers|
|Ref admits error in key foul call on Lonzo Ball in Lakers-Thunder game|
|Marina Granovskaia is working very hard – Sarri ´confident´ of January signings|
|Tuchel confirms Rabiot out of PSG contention|
|Madrid derby kick-off confirmed for February 9|
|Benzema fit to face Sevilla despite broken finger, Solari confirms|
|Bournemouth boss Howe says no offers received for Wilson|
|Kerber cruises after Wozniacki, Sabalenka upsets|
|Mbappe a great player and great person, says beaming Beckham|
|Gracia confident someone will step up if Doucoure leaves for PSG|
|Albrighton signs new Leicester deal|
|Niasse joins Cardiff on loan from Everton|
|Hendrick credited with Fulham strike|
|Western Sydney Wanderers 1 Adelaide United 2: Goodwin compounds Wanderers woes|
|Chahal and Dhoni carry India to ODI triumph|
|Levante report Barcelona for alleged use of ineligible player in Copa del Rey|
|Solskjaer regrets Sanchez´s Reading setback|
|Tomic brands Hewitt a ´liar´ as feud continues|
|Ruthless Nadal thrashes teenager De Minaur|
|Wozniacki enjoyed status as defending champion in Melbourne|
|Solskjaer backs Mourinho to return to football´s big time|
|Murray to miss Open 13 Marseille|
|Solskjaer´s United turnaround no easy task, says Hughton|
|The big Friday Premier League quiz|
|How James Harden´s 2018-19 numbers compare to his MVP campaign|
|It´s insane! - Tsitsipas excited to face ´legend´ Federer|
|Sharapova ends Wozniacki title defence|
|American teen Anisimova sends records tumbling at Aus Open|
|Lakers survive Ball´s gaffe to beat Thunder in OT|
|Federer expects ´athletic´ and ´attacking´ Tsitsipas clash|
|Alcacer is fit and available – Favre|
|Fantastic Federer breezes past Fritz|
|Pogba happy with Man United approach under Solskjaer|
|Mickelson leads Desert Classic, ties career-low with 12-under 60|
|Warriors´ Durant on Curry: He´s a once-in-a-generation, once-in-a-lifetime talent|
|Patriots owner says Brady is greatest player, not just quarterback, of all time|
|Inglis to retire from representative duty this year, NRL in 2020|
|Is Beal better without Wall? Wizards star says it´s ´absolutely nonsense´|
|Rockets C Capela undergoes thumb surgery, expected back after All-Star break|
|This Week in U.S. Sports: Irving apologises, Machado´s agent isn´t happy|
|Knicks in woeful shape, but 2019 could still be bright in New York|
|Valverde not worried about Levante´s Copa appeal|
|Nowell an option for England at flanker, reveals Jones|
|Pellegrini: Arnautovic available for the right price|
|Knicks throw away 19-point lead and lose on last-second goaltending call|
|Tebow invited back to Mets´ major league spring training|
|Canelo and Jacobs agree unification fight|
|Barcelona 3 Levante 0 (4-2 agg): Dembele at the double as Barca advance|
|Levante to lodge complaint over Barcelona Copa selection|
|Kanter´s London absence ´very unfortunate´, says NBA commissioner|