With that, Rankin had captured the first-ever Test wicket for Ireland and wrote himself into the history books.
There was drama at an initially sun-drenched Malahide right from Saturday's first ball of this stand-alone match.
Azhar Ali dug out a Murtagh delivery and called for a quick legside single.
The batting of Ireland, the 11th nation to play men's Test cricket, was always likely to prove decisive in the outcome of this one-off match.
West Ham United vs Manchester United
But since the moment we felt it was impossible to finish first we had the target to finish second and it is done today. Which is more than one can say for the quality of the football in east London .
Former England one-day global Joyce, arguably Ireland´s greatest batsman and at 39 the oldest Test debutant since Australia´s Bryce McGain made his bow aged 36 in 2009, appeared to be a victim of the fact the Decision Review System was not being used in this match because Cricket Ireland had decided they could not afford the cost for a one-off game.
The 22-year-old was left flat on the ground and needed several minutes´ treatment on the field, but he recovered to face the second ball of the match, with Imam playing and missing.
"We're (less than) 120 behind, we know we're going to have to bat really well but I think the two lads showed at the end there that it's definitely possible", Wilson said.
Faheem was in sight of a hundred on Test debut when he was caught behind off medium-pacer Stuart Thompson for 83, the innings' top score.
Rankin had an uncertain Azhar (four) edging to Porterfield at second slip.
That left Pakistan 13 for one off the last ball of the eighth over.
Ousted Malaysian Prime Minister Banned From Leaving Country
However, anxiety has stirred among his supporters as he was not sworn in by the king this morning as expected. He has pledged to get Mr Ibrahim, who is due out of jail in June, a royal pardon.
But with Mick Jagger, a lifelong cricket fan, among the crowd - the Rolling Stones play a concert at Dublin's Croke Park on Thursday - the openers gave Ireland some satisfaction in a day dominated by Pakistan. "So did the coach, Mickey Arthur and Sarfraz (Ahmed, the Pakistan captain), especially after the retirements of Misbah and Younis, so it's now my responsibility to take that number four position".
Imam was lbw for seven to a Murtagh delivery that came back into him.
Shafiq square-cut Kane for four, with left-hander Haris glancing Thompson for a legside boundary. On the third day, Pakistan will look to bank on the two to continue the scoring and increase the total past 350.
Shafiq was the next to go, for a well-made 62, and it was Rankin that got him with a short ball.
But with the towering Rankin, bowling from around the wicket, a similar shot proved Shafiq´s undoing when he found Andrew Balbirnie at square leg.
Kiwi cyclist George Bennett maintains top 10 place at Giro d'Italia
Bennett is the first Irish victor of a Giro d'Italia stage since Stephen Roche in 1987. This is the best start for the Giro d'Italia", said Chaves on the finish line.