Haris Sohail was 28 not out and Asad Shafiq 22 not out.
Imam ul-Haq (7) went the very next ball, to Murtagh, struck on the knee roll and given out leg before wicket, leaving Pakistan at 13-2.
Earlier, Ireland had a first ball in Test cricket to remember when Azhar took a single off bowler Murtagh.
In a huge scramble, Ul-Haq made a last-ditch dive towards the stumps only to collide with the Irish duo of wicket-keeper Niall O'Brien and fielder Tyrone Kane.More news: Brazil confirm Dani Alves will miss World Cup due to knee injury
As luck would have it, Pakistan staged the second fight back, and this time they really did show stomach for the fight as Shadab and Ashraf stitched together an unbeaten 109-run stand for the seventh-wicket before the rain arrived and curtailed played by eleven overs.
Imam-ul-Haq, who is the nephew of Inzamam-ul-Haq, will also likely make his test debut.
Ireland's first day of play in Test cricket started and ended with a bang with a dramatic first delivery opening affairs and a clap of thunder and a flash of lightning ending play at Malahide with Pakistan having firmly taken the upper hand.
Rankin had an uncertain Azhar (four) edging to Porterfield at second slip.
Shafiq is the class act of this Pakistan batting line-up and he moved past his half-century and had moved on to 62 before he played a poor pull shot to a short ball from Rankin, with Andrew Balbirnie taking the catch at square leg to leave Pakistan on 153 for five.More news: David Goodall's death a final contribution to society, says daughter
It was not the start either side wanted with Pakistan keen to avoid early wickets and Ireland desperate to get on with the game after the Friday washout cost Cricket Ireland €75,000 (£66,000) in ticket refunds.
Shafiq square-cut Kane for four, with left-hander Haris glancing Thompson for a legside boundary.
Pakistan, 67-2 at lunch, lost their third wicket soon afterwards when Haris (31) was caught in the gully by Porterfield off Thompson.
Babar Azam (14), pushing hard at a Murtagh delivery that left him off the pitch, was well-held by Paul Stirling at second slip.
For Ireland, the new ball - four overs away - will offer some succour as they look to take the last four wickets they need. And when Pakistan captain Sarfraz Ahmed (20) was caught by Stirling in the slips off Thompson, the tourists were 159 for six.More news: Avengers movies might continue, according to Disney's Bob Iger
The match will now be a four-day Test with follow-on imposed on the teams to be of 150 runs rather than 200.