Five balls later Pakistan were shell-shocked, the scoreboard remarkably reading 14 for three, as Murtagh took his second wicket of the day with the Ireland strike bowler sending an absolute corker down the track and straight through between bat and off stump, as Asad Shafiq was out for a solitary run.
However, an unbeaten 74 for Imam-ul-Haq and Babar Azam's 59 helped the tourists claim a victory that had been on the cards once they bowled Ireland out for 130 on Sunday to establish a 180-run lead.
O'Brien became the first player to score a Test century for Ireland and he was there at the close on 118 not out, with his 114-run partnership with Stuart Thompson (53) for the seventh wicket proving decisive.More news: How To Watch Cavaliers vs. Celtics Game 1
Abbas swiftly removed Boyd Rankin (6) and Tyrone Kane (14) to return second-innings figures of 5-66.
An innings defeat was still a possibility when Amir, given a jail sentence and banned from cricket for five years as a result of his involvement in a spot-fixing scandal during the 2010 Lord´s Test, took his 100th wicket in 31 matches at this level when Gary Wilson was held in the slips by Haris Sohail.
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.
Pakistan struggled to complete a relatively modest run-chase against Sri Lanka past year and a furious bowling spell from Ireland's seamers sent a thrill of expectation around the ground.More news: Dee Gordon ready to play second base for Mariners with Cano out
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.
Man of the match, Kevin O'Brien, hit a century yesterday - he says it was tough to regain his focus today.
"Hopefully in the next week or two there's going to be hundreds of little kids aspiring to be Kevin O'Brien in backstreet cricket", the Irish captain said. Victory was a good way for Pakistan to prepare for the first of a two- Test series against England at Lord's starting on May 24. But with Pakistan 20 runs shy of victory, a mix-up saw Babar run out.
Ireland can be extremely proud and their display gave a basis to compete on equal terms and they certainly do not look like the new boys of Test cricket. It's in the name and you do get tested throughout. That's the character we've had and to be able to bring that into first Test is pleasing.More news: Maple Leafs promote Kyle Dubas, 32, to GM
The performance against Pakistan was full of positives, and although the future test match against India will provide a completely different game and possible eye-opener on test cricket - the blocks are there for Ireland to produce a competitive Test cricket team.
- It became known as "fakes" found in Facebook
- SC Collegium sticks to Joseph's elevation
- Stormy Daniels' lawyer spotted with Christie Brinkley
- Tiger Woods shoots 65, his lowest score ever at Players
- Raw 5/14 Taping Spoilers: Money In The Bank Qualifiers
- John Bolton: Trump Sanctions On European Companies "Possible" Over Iran
- Pakistan bars US diplomat from leaving country
- Fortnite Buffs Thanos' damage, The Avengers: Infinity Mode balance
- United States will help China's ZTE 'get back into business'
- Top Senate intelligence Democrat to vote for Trump's CIA chief nominee