The centurion looked to be visibly tiring at the tail end of the day and almost chopped Abbas on shortly after edging Amir wide of the only slip and probably should have been out leg before in the final over of the day but he and Tyrone Kane (8*) would end the day still out there on 319 for 7 having added an unbroken stand of 48 for the seventh wicket to take Ireland to a lead of 139.
The collective first-class experience of Ireland stands at 1,103 matches, which is substantially more than Pakistan's 799.
After surviving a tense final few overs, in which he relied on luck more than judgement to keep his wicket intact, O'Brien admitted that he wasn't used to "these longer forms" and paid tribute to his batting partners, Stuart Thompson, who also made a half-century, and Tyrone Kane, who was unbeaten on 8 at the close.
O'Brien, the man for the big occasion, had just scored Ireland's first Test century in their debut Test, seven years after he scored the fastest World Cup hundred to help Ireland beat England at the 2011 tournament.
The day started on an uncertain note for Pakistan quick Amir following a recurrence of his knee injury that forced him out of the attack on day three.More news: Fulham take a step closer to EPL promotion
"It was a very proud and emotional moment, to get there is a great honour, and hopefully we've put ourselves in a good position to go on and win it", he added.
And only three teams - one for every century in which Test cricket has been played - have won after following-on, with South Africa in 1894, England in 1981 and India at Kolkata in 2001, all beating Australia having been sent back into bat. The first day was washed out. However, the away side made a strong comeback with their lower order and went on to declare at 310/9 just before lunch on Day 3 as debutant Faheem Ashraf scored a memorable 83.
The prospect of defeat loomed ever larger after Amir dismissed any doubts over his ability to produce pace by sending Niall O'Brien's (18) off and middle stumps careering out of the ground, before then claiming the scalp of captain William Porterfield (32). Both players added 114 runs for the seventh wicket. Ireland were still 23 runs behind, now with just four wickets remaining. He had to bowl cautiously but still had enough skill to move the ball around and get the nick off Gary Wilson's bat to pick up his 100th Test wicket.
Pakistan took the new ball but it was leg-spinner Shadab Khan, not the pacemen, who struck next when he turned one sharply to bowl left-hander Thompson for 53.