At that stage, Amir had taken two wickets for no runs in six balls.
Imam shared a vital 126-run stand with Babar Azam (59) for the fourth wicket.
The partnership built between the two shows great signs for Pakistan's upcoming test against England in Lords, most notably Imam's outstanding batting performance. And 94 for three became 95 for four when Amir had Ireland captain William Porterfield (32) edging to wicket-keeper Sarfraz Ahmed, the Pakistan captain.
Man of the match, Kevin O'Brien, hit a century yesterday - he says it was tough to regain his focus today.
Pakistan bowling coach Azhar Mahmood suggested after stumps on Sunday that Amir's lengthy time away from the game allied to the fact he had been involved in all three global formats-Tests, one-dayers and Twenty20s-since coming back had taken a toll on the swing bowler.
Result: Pakistan won by five wickets.
When Tim Murtagh grabbed his sixth wicket of the match, Pakistan were a barely credible 14-3 in pursuit of 160 to win and Ireland's dreams of becoming only the fourth side to win after having to follow on were nudging into expectation territory.
Pakistan, understandably enough, have been struggling to replace the likes of retired veteran batsmen Misbah-ul-Haq and Younis Khan. Both players added 114 runs for the seventh wicket. There were 11 caps being handed out, we had all our family and friends here and with all the build up to the game there were a lot of emotions for every lad, so to go out and start how we did was fantastic.
Kevin O'Brien batted for over five hours and faced 216 deliveries en route to his historic Test century on Monday. Unfortunately for Ireland, Andy Balbirnie failed to grab on to a relatively simple catch at third-slip to give Pakistan a huge reprieve.
Pakistan then slipped to 2-13 for the second time in the match when Haris Sohail attempted one drive too many and picked out Ed Joyce at gully off Rankin.
"But Test cricket is Test cricket for a reason, it's there in the name; you do get tested and we were after the first innings". These are exciting times for Irish cricket, and there's no doubt that they can compete.
"I still think for me Bangalore is definitely number one just for the sheer moment it was, and against who it was, being in the World Cup". They proved the doubters wrong and have gained respect in the cricket-sphere. This is the first occasion when four debutants scored 50+ in a Test match.
This was a game to display the true folly of the ICC's exclusionary policy in Test cricket with Ireland showing that the game's oldest form could only benefit from fresh blood, that the sport is only dying out while its governing body allows it to.
The future of Irish cricket is bright.