History made in Malahide as Kevin O'Brien becomes first cricketer to hit a test match century for Ireland
It was a historic day in Malahide for Kevin O'Brien as the batsman finished day four of the test match between Ireland and Pakistan on 118 not out.
It represents the first ever test match century for Ireland, which helped them take a 139-run lead into day five, on 319-7 after 122 overs.
Ireland resumed the penultimate day at Malahide on 64 without loss in their second innings, still 116 behind Pakistan's first-innings total, but they lost Ed Joyce with just five more on the board when he was run out on 43 by Faheem Ashraf's direct-hit.
In the over after Joyce departed, Ireland's number three Andrew Balbirnie suffered a pair, again falling lbw to Abbas, with the hosts' top order in danger of swiftly collapsing once more.
Both Niall O'Brien and William Porterfield should have been run out before Pakistan captain Sarfraz Ahmed finally turned to Amir, who bowled beautifully in beating Porterfield's outside edge on multiple occasions.
It looked as if that Irish duo would see Amir's spell off but he rallied with a full delivery that uprooted O'Brien's off and middle stumps - and nearly took leg out too - before Porterfield edged behind to Sarfraz off the same bowler.
That left Ireland 95 for four, still 85 behind, as lunch approached.
Mercifully for Ireland, Amir was eventually taken out of the attack and temporarily left the field as Paul Stirling and Kevin O'Brien tried to dwindle down their side's deficit.
At lunch the hosts were 123 for four, still needing 57 more to reach Pakistan's first-innings total.
Abbas had another lbw appeal go in his favour to send back Stirling after lunch but Kevin O'Brien and Gary Wilson continued to bring the hosts closer to ensuring Pakistan would have to bat again.
However, that partnership was broken up, predictably by Amir, who came back into the attack and claimed his 100th Test wicket when Wilson went fishing outside off and edged to first slip.
With four wickets in hand, Ireland needed just 20 more to avoid an innings loss.
Amir nearly found Stuart Thompson's edge too with the very next ball but the Irish number eight quickly settled and he and Kevin O'Brien took 14 runs in two overs from Pakistan's chief threat.
That brought the hosts within touching distance of erasing Pakistan's lead and they moved ahead in the contest for the first time courtesy of Kevin O'Brien's edged four past the vacant second-slip region.
That took Ireland's most experienced cricketer onto 48 and he became their first male half-centurion in the Test format with a single down the ground.
Pakistan took the new ball prior to tea, with Ireland owning a lead of 13, hoping to wrap up their innings.
But the runs were flowing as Kevin O'Brien and Thompson remained at the end of the second session, increasing their team's advantage to 32 thanks to a partnership worth 55.
Kevin O'Brien finished the day not out on 118, having nearly played on to Abbas in the day's final over, as Ireland reached 319 for seven by stumps.
That meant their lead was 139, setting up an intriguing final day in Malahide.