Afghanistan batsman Rahmat Shah fell two runs short of his country's first-ever Test century as he guided his team to a 142-run first innings lead over Ireland on the second day of the one-off Test match on Saturday.
The Irish team lost captain William Porterfield in the closing hour of the game at 1-22 after Afghan batsmen had dominated the day in the north Indian city of Dehradun.
Maiden half-centuries by Asghar Afghan (67) and Hashmatullah Shahidi (61) piled up 314 all out in reply to 172 from the visitors.
Afghanistan resumed the day's play at 2-90 with Shah and Shahidi sharing a 130-run stand for the third wicket before Andy McBrine picked up Shahidi.
Shah continued his journey towards a maiden hundred but his innings ground to a halt at 98 off 214 balls when he chopped on a delivery by Tim Murtagh.
Murtagh, who saved the day for Ireland in the first innings after scoring an unbeaten maiden Test half century at number 11, had bowling figures of 1-33.
Ireland trail by 120 runs with eight wickets in hand on day three of the match after the team's battling line-up crumbed against the Afghan spin attack on day one.
Stuart Thompson picked up 3-28, including the wicket of allrounder Mohammad Nabi for nought, while McBrine took 2-77.
Andy Balbirnie (14) and Paul Stirling (8) were at the crease at the close of the play, with Afghan bowler Yamin Ahmadzai ending the day at 1-9.
Both sides are playing their second Test after making their debut in the five-day format last year.
Afghanistan lost to India inside two days in Bangalore while Ireland went down to Pakistan in Dublin.