Rahmat Shah fell just short of Afghanistan's first Test century but fifties from Hashmatullah Shahidi and Asghar Afghan pushed it into a strong position on day two against Ireland.
Rahmat fell on 98 and Afghanistan was eventually bowled out for 314, reaching stumps with a lead of 120 runs and boosted by the dismissal of captain William Porterfield for a duck in Ireland's second innings.
Afghanistan – which skittled Ireland for just 172 in its first innings on day one – added 67 runs to its overnight total in the first session before Andy McBrine broke the 130-run union between Rahmat and Shahidi, trapping the latter lbw on 61.
Rahmat chopped on agonisingly close to a maiden Test century and Mohammad Nabi followed before tea, with Asghar receiving minimal support from the tail during his knock of 67. Rashid Khan was the only other Afghanistan batsman to reach double figures as Stuart Thompson claimed figures of 3-28.
The sixth and final wicket to fall in the last session was that of Porterfield, who edged Yamin Ahmadzai behind second ball as Ireland reached the close on 22-1.