Rahmat Shah came agonisingly close to making Afghanistan's first Test century before Ireland hit back with the new ball on the second day of the one-off cricket Test on Saturday.
Shah's 98 off 214 balls included 15 fours and carried Afghanistan to 5-242 at tea in Dehradun, replying to Ireland's first innings of 172.
Afghanistan now leads by 70 runs with captain Asghar Afghan on 19 and Ikam Ali Khil alongside on three.
Shah and Hashmatullah Shahidi (61) featured in a century stand and denied Ireland success in the first session after they resumed on 2-90.
Both batsmen played solidly against both spin and seam as Ireland conceded only 20 runs in the first hour.
Shah completed his maiden half-century off 121 balls by pulling left-arm James Cameron-Dow's first ball for his ninth four as Afghanistan moved to 2-157 by lunch.
Ireland had to wait nearly an hour after lunch before it finally broke the 130-run partnership when off-spinner Andy McBrine had Shahidi lbw.
Left-handed Shahidi batted resolutely, hitting six fours in his 154-ball knock before he erred when attempting a sweep shot.
Tim Murtagh, who scored a half century in first innings while batting at No. 11, then struck immediately with the second new ball when Shah played on to the fast bowler.
Shah couldn't believe he missed making history for Afghanistan and stood at the crease with his head down before walking back to the dressing room in disappointment.
Seamer Stuart Thompson then dealt another blow in the next over when all-rounder Mohammad Nabi was dismissed without scoring after attempting a loose drive.
Both teams are competing in only their second test match since gaining Test status in 2017.
Last year, Afghanistan lost its debut Test against India, and Ireland was beaten by Pakistan in its inaugural Test.