Up stepped Kevin O'Brien, who became the first Irishman to score a century in test cricket while racking up an unbeaten 118. The Merrion all-rounder, who was a surprise pick and still looking for his first Test wicket last night, had offered O'Brien stout resistance in an eighth-wicket partnership of 50 and now helped Boyd Rankin eke out another 11.
With Ireland lying 160 runs behind, Pakistan elected to enforce the follow-on for the first time in their history and make Ireland bat again.
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.
"To get up to close to 350 showed what we've got in the changing room and the passion that we have for playing our cricket".
Although the crowd was small at that stage of the morning, Ireland's supporters were making plenty of noise as Tim Murtagh took the new ball from the Dublin Road end, tasked with getting among the Pakistan top order.
American clothing brand Gap 'terribly sorry' over China map shirt omitting Taiwan
In the statement sent to the Global Times , Gap said the T-shirt has been pulled off shelves in the Chinese market and destroyed. Vietnam, the Philippines, India and Taiwan all protested against the move.
But O'Brien's circumspect batting - his 118 has come from 216 balls and contained 12 fours - has ensured Ireland stay alive at Malahide.
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.
Although it was nearly inevitable that the upset was too far gone, Ireland further added to a respectable scoreline and outstanding match in general producing a further outing through Stuart Thompson's dismissal of Safraz Ahmed for 8, Pakistan now at 152-5.
Their previous Test, against Sri Lanka in the UAE in October, saw them beaten after a target of 136 proved beyond them as left-arm spinner Rangana Herath took six wickets for 43 runs.
Man of the match, Kevin O'Brien, hit a century yesterday - he says it was tough to regain his focus today.
Pakistan now heads to England for a two-test series, starting next week at Lord's. 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. That's always been known to be there but Test cricket is Test cricket for a reason, it's there in the name, you did get tested and we were after the first innings.
O'Brien was just the fourth player to reach three figures in his country's first men's Test, with Australia's Charles Bannerman, Zimbabwe's Dave Houghton and Bangladesh's Animul Islam the others.