Afghanistan displayed their stomach for a fight in their maiden test by claiming five wickets in the final session to leave India on 347 for six after the opening day of the one-off contest on Thursday.
India's Shikhar Dhawan and fellow centurion Murali Vijay raised 168 runs for the opening stand to vindicate the decision to bat as the hosts cruised to 280 for one after thoroughly dominating the first two sessions.
Afghanistan, who became the 12th test playing nation, clawed their way back in the final session at the M Chinnaswamy Stadium with some lion-hearted efforts by the bowlers against their top-ranked hosts.
Hardik Pandya was batting on 10 with Ravichandran Ashwin on seven at the other end when stumps were drawn.
Earlier, Dhawan became the first Indian to smash a century in the first session of a test as he and Vijay capitalised on Afghanistan's limited bowling resources built around their spinners.
Left-handed Dhawan batted in the limited-overs mode to smash 107 off 96 balls, studding his blistering knock with 19 fours and three sixes.
Seamer Yamin Ahmadzai claimed Afghanistan's first wicket in test cricket after the lunch break when Dhawan edged him to Rahmat Shah, who parried it towards the safe hands of Mohammad Nabi at first slip.
Vijay then took charge and punished Afghanistan's three-pronged spin attack of Rashid Khan, Mujeeb Ur Rahman and Nabi on both sides of the wicket.
However, the tourists struck back in the final session.
India score 347/6 on day one of the Historic Test after late strides fron Afghan bowlers.— Afghan Cricket Board (@ACBofficials) June 14, 2018
Afghanistan's Yamin Ahmadzai took 2 wickets while Rashid Khan, Mujeeb ur Rahman and Wafadar took one wicket apiece. #AFGvIND #INDvsAFG #HistoricTest pic.twitter.com/1VWDmZErks
Vijay fell leg-before after offering no shot to a Wafadar delivery to depart for 105. The right-hander's 12th test century included 15 boundaries and a six.
Two balls later, Lokesh Rahul, promoted to number three ahead of Cheteshwar Pujara, chopped an innocuous Ahmadzai delivery onto his stumps to depart after a fluent 54.
Leading the Indian side in the absence of regular skipper Virat Kohli, who is recovering from a neck injury, Rahane made 10 before becoming Rashid's maiden test victim.
Pujara scored 35, while stumper Dinesh Karthik, playing his first test in eight years, made four before being run out in the frantic third session.
India 347 for 6, day 1
Shikhar Dhawan 107, Murali Vijay 105; Yamin Ahmadzai 3-51