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.
|Pedroia to return for Red Sox on Friday|
|Warriors´ Iguodala ruled out for game five against Rockets|
|Na leads as Spieth makes solid start at Colonial|
|James Harden, LeBron James headline 2017-18 All-NBA first team|
|Manchester United target Fred to decide future after World Cup|
|´Incredible´ Salah is like Messi, says Ronaldo|
|Salah a big candidate for Ballon d´Or - Muller|
|Message from coach keeping Masters champion Reed grounded|
|Anybody can really win it - Seles feels French Open is wide open this year|
|Mambo number 5! - Non-league star channels Lou Bega hit|
|Pakistan to stop wearing smart watches after ICC intervention - Hasan|
|Saha hails ´great man´ Ferguson as legendary Man Utd boss continues recovery|
|Emery´s depth of knowledge impressed Arsenal´s Gazidis|
|Conceicao extends Porto contract|
|Lomax impresses as Saints overrun Tigers|
|McIlroy in contention at Wentworth as Bjerregaard sets the early pace|
|Bad light calls time on Thiem, Wawrinka out in Geneva|
|Garitano in, Canales out at Real Sociedad|
|Caparros accepts new role at Sevilla|
|Pliskova downed by Larsson after drawing Serena in Paris|
|They´re using the anthem as fake patriotism - Warriors coach Kerr critical of NFL|
|Lyon win record fifth Women´s Champions League title|
|French Open 2018: Doing the unthinkable - the men most likely to topple Nadal|
|French Open 2018: How can Rafael Nadal be stopped?|
|Steve Smith named as marquee player for Global T20 Canada|
|Can Emre play? Yes he Can... and so can Milner|
|Liverpool working to help fans after flight cancellations|
|Abbas and Hasan torment sorry England|
|Xavi ´thrilled´ to sign two-year Al Sadd extension|
|Holtby extends Hamburg contract despite relegation|
|Nadal begins French Open defence against Dolgopolov|
|Serena drawn to play Pliskova in French Open first round|
|FA condemns assault of match official|
|Bologna confirm Donadoni departure|
|Yates lead halved in Giro d´Italia|
|Connacht turn to Friend|
|Scotland lose injured Dunbar for June tour|
|Spalletti in ´no rush´ to sign new Inter deal|
|Ricciardo and Red Bull dominate Monaco practice|
|Mauricio Pochettino signs new deal with Tottenham|
|Pochettino signs new deal with Tottenham|
|Istanbul to host 2020 Champions League final|
|Williams sisters given French Open wildcard|
|President Donald Trump praises NFL´s anthem stance|
|Buffon in consideration for Italy call, says Mancini|
|Roberts injured in Broncos win against Eels|
|Atletico complete move for Villarreal star Rodri|
|Ozil, Gundogan not playing politics, says Low|
|Valencia complete permanent Kondogbia signing|
|Fairytale ending could be in the script, says World Cup-bound Vardy|
|Milwaukee police apologise to Bucks´ Brown over tasering|
|Television, crosswords and Nintendo - Koscielny´s remedy to World Cup heartache|
|World Cup not an audition for Barca or Madrid, says Germany star Werner|
|Neck injury rules Kohli out of Surrey stint|
|Nine LaLiga titles and 674 club games under nine managers - Iniesta in Opta numbers|
|49ers Enterprises takes stake in Leeds United|
|Manchester United should sell Pogba if he´s unhappy - Scholes|
|Andres Iniesta´s nine LaLiga triumphs with Barcelona|
|Andres Iniesta: The footballers´ footballer|
|Real Madrid v Liverpool: Salah has foundations in place for Ballon d´Or challenge|
|Iniesta´s Vissel Kobe move confirmed|
|Low upbeat over Neuer´s World Cup hopes|
|´No secrets´ in playoffs, says Celtics rookie Tatum|
|Real Madrid v Liverpool: Salah takes his chances better than Ronaldo - Opta|
|Cubs, Yankees find very different ways to lose|
|Cole hoping to see Rooney in MLS amid DC United links|
|LeBron feeling worn down following Cavs loss|
|Rahm enjoys ´traditional golf courses´|
|Upbeat Spieth eyeing first win of 2018|
|Ovechkin leads Capitals into Stanley Cup Finals|