Kevin O'Brien became the first Ireland batsman to score a 100 in men's Test cricket as the debutants avoided an innings defeat by Pakistan.
Ireland, made to follow-on, were 319 for 7 on the fourth day at Malahide — a lead of 139 runs.
O'Brien was 118 not out, having top-scored, with Stuart Thompson 58 providing good support.
Earlier, Pakistan's Mohammad Amir took his 100th Test wicket and for all O'Brien's defiance the tourists remained well-placed to win this one-off match Ireland started the day on their highly creditable overnight 64 without loss.
But they lost four wickets in Monday's first session, with left-arm quick Amir — who had both openers dropped during a brief spell on Sunday before going off with a knee problem — enjoying a burst of two wickets for no runs in six balls.
It was a heartening sign for Pakistan ahead of their upcoming two-Test series in England that will feature back-to-back fixtures at Lord's (May 24-28) and Headingley (June 1-5).