Pakistani bowlers didn't get any more wickets in the last session barring the one of Thompson, as the Irish team found themselves at 319 for the loss of 7 wickets at stumps on Day Four in the Dublin test.
Babar Azam also scored a fifty in this innings.
O'Brien himself, Ireland's first Test centurion, had not added to his overnight 118 when he was caught behind and despondently departed having faced 217 balls and hit 12 boundaries.
Abbas wrapped up the innings, and his second five-for in Tests, when he bowled Rankin (6) and Tyrone Kane (14) off inside-edges - but it was then Ireland's pacemen who came to the fore.
Ireland deserve place in Test arena says William Porterfield
An innings defeat was still a possibility when Amir, given a jail sentence and banned from cricket for five years as a result of his involvement in a spot-fixing scandal during the 2010 Lord´s Test, took his 100th wicket in 31 matches at this level when Gary Wilson was held in the slips by Haris Sohail.
The unanimous verdict from the cricket world showed that it was great to see Ireland play Test cricket, and even greater to come out with an extremely competitive performance on their Test debut.
With the lead of 139 runs in the bank and Kevin O Brien still unbeaten on 118, Ireland sense a little hope for victory.
The 11th Test nation's optimism began to dissipate with Imam and Azam at the crease, though the former was fortunate an edge dropped short off Murtagh and the latter was nearly undone by a Rankin yorker.
Noteworthy Stock to Watch For: The Home Depot, Inc. (HD)
Sypris Solutions, Inc . (NASDAQ: SYPR ) is projected to report quarterly loss at $0.07 per share on revenue of $20.35 million. This number is based on a 1 to 5 scale where 1 indicates a Strong Buy recommendation while 5 represents a Strong Sell.
Kevin O'Brien is handed the man of the match award by Ross McCollum and Rameez Raja.
When Pakistan slipped to 14 for three in pursuit of 160, the Irish were in with a sniff of marking their inaugural men's Test with a victory to compare with any.
The now 26-year-old Amir's cricket career nearly came to an end following his involvement in a spot-fixing scandal during a 2010 Test against England at Lord's.
The third-wicket partnership had only got to 25 when O'Brien was bowled, playing across the line to Amir, and when Porterfield followed for the addition of only one more run, a good diving catch to his left by the keeper, Ireland were 95-4.
Disney: 'Infinity War' Draws $200M in China Debut
It ousted Universal's " The Fate of the Furious ", which drew $541.9 million worldwide on its opening box office release in 2017. AIW also posted the highest pre-sales record of all-time in China with a total of 400 million yuan ($63 million).
Chasing 160, Imam (74 not out) and Azam (59) forged a crucial partnership to guide Pakistan to a comfortable victory after the visitors had slipped to 14/3.
"I think it was a fantastic team effort, yesterday belonged to Kevin and very well supported by Tommo and TK". Pakistan have a lot of good young players coming up, and the chance been provided to these young lads in their young careers is giving Pakistan cricket a bright future.
Cricket Ireland have said that one or two Test matches a year will probably be the limit that the Ireland side will play. That's the character we've had and to be able to bring that into first Test is pleasing.
But after a glorious four days in Malahide, following a washed-out opening day, there is now no question that the 11th team to play Test cricket are in any way out of place.
DR Congo: 2 kidnapped British tourists released
The park, which is a Unesco world heritage site, is home to critically-endangered mountain gorillas, lions, elephants and hippos. Two Britons kidnapped in a national park in DR Congo have said they are "very grateful" after their release.