Imam-ul-Haq (74 not out) and Babar Azam (59) then combined to dash dreams that Ireland, the 11th nation to play men's Test cricket, would record a remarkable win.
But it was a testament to Ireland's skill and resolve that after they had been made to follow-on by visiting captain Sarfraz Ahmed, the game remained in the balance on the final day.
For a while, it seemed Ireland might rewrite the record books on two fronts in becoming only the fourth side to win a Test after following-on and just the second in the 141-year history of the format, following Australia's defeat of England in the inaugural 1877 Test at Melbourne, to win their debut match.
That they were in a position to do that owed much to Kevin O'Brien's impressive 118 -- just the fourth instance of a man scoring a century in his country's first Test match -- that was the cornerstone of Ireland's second innings 339.
"The biggest thing was how we fought back in the second innings with the bat -- that showed the character we have," he said.
"It's something that's been talked about during big occasions, World Cups. 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.
"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." The crowd briefly included 74-year-old Rolling Stones front man and cricket fan, Mick Jagger, but Porterfield hoped that the next generation of potential Irish cricketers would be more inspired by O'Brien's hundred.
"This Test match will have gone a long way to providing the next generation of cricketers, I'm sure." - 'World Cup noise' -
This was O'Brien's first international century since he scored the fastest-ever World Cup hundred, off just 50 balls, in Ireland's stunning win over England at Bangalore seven years ago.
Yet the controversial decision to shrink the 2019 World Cup in England to a 10-team tournament and Ireland's failure to come through an increasingly competitive qualifying tournament where only two spots were available means Porterfield's men will be on the outside looking in next year.
"We wouldn't have got to where we were if we didn't get those opportunities to put down a marker on the world stage," Porterfield insisted.
"That gives you an opportunity to create enough noise. To miss out by it just being a 10-team World Cup is bitterly disappointing.
"We wouldn't have had the opportunity to play a Test match today, I don't think if we hadn't been playing the last 10, 12 years at World Cups.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)