Hours earlier on day four, the Irish faced the prospect of an innings defeat but they lost only three wickets in the final two sessions to reach stumps on 7-319 in their second innings after following on.
Ireland had briefly harboured dreams of shocking Pakistan in their debut Test but Imam-ul-Haq, playing his first Test himself, denied the Irish with a composed innings.
"It's really good that these two young players in our team, Imam-ul-haq and Babar Azam, the way they played, they showed their character and confidence".
O'Brien, who had been pivotal to Ireland's fightback on Monday, fell to his first ball of the day chasing a wider delivery and nicking to slip. But after Tyrone Kane had seen out Tuesday's opening over from Mohammad Amir, who took his 100th Test wicket on Monday, Abbas struck.
Ireland, making their debut in men's Test cricket, was bowled out for 339 in their second innings after being made to follow-on.
Mohammad Abbas took four wickets while Shadab Khan scalped three wickets.
"How we went about that to get up close to 350 just showed what we've got in the changing rooms and the passion that we've got".
But after the break, Thompson upped the tempo and while O'Brien was content to nudge the singles, Thompson took 11 off an over from left-armer Rahat Ali and followed up with two more off Amir.
Imam guides Pakistan to victory over test debutant Ireland
Thompson then pinned Sarfraz Ahmed in front but Pakistan got over the line prior to tea, with Imam unbeaten on 74.
Joined in the middle by number five batsman, Babar Azam, Imam began to settle into his innings and before long, secured his half-century, displaying a fine array of shots to make light work of the Irish bowling.
Yet he missed Kevin O'Brien post a century the following day - a feat Porterfield hopes can have a lasting impact for the future of the game in the country.
A quick turnaround, as Pakistan came out to knock off the 160 runs needed to secure the victory ahead of their tour of England.
Man of the match, Kevin O'Brien, hit a century yesterday - he says it was tough to regain his focus today. It was a worrying sign for Pakistan, who next play a warm-up match against Leicestershire (May 19-20) before facing England in a two-Test series, with back-to-back fixtures at Lord's (May 24-28) and Headingley (June 1-5) leaving little time for rest and recovery.
"I think it's very good for Pakistan as a team to chase this on the fifth day".
Following-on, Ireland started the fourth day on 64 without loss.
What were your highlights from Ireland's first ever 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.
Pompeo: US to Lift Sanctions if North Korea Dismantles Nuclear Weapons Program
In one of the first signs that Kim was willing to concede Punggye-ri, he announced last month that the site had "done its job". Moon said Monday that the North's move shows how honest the country is about making the talks between Kim and Trump a success.