Afghanistan clawed their way back after India's Shikhar Dhawan hit a blazing century on Thursday as the minnows capped their astonishing rise from war and refugee camps to joining the sport's elite.
Test cricket's newest team were on the receiving end of some aggressive batting as Dhawan, who smashed 107, and Murali Vijay, who made 105, put on a 168-run opening stand after the hosts elected to bat first in Bangalore.
But the Afghan bowlers struck back with four wickets in the final session as the hosts slipped from 280 for one to 347 for six at stumps at Bangalore's M Chinnaswamy Stadium.
Fast bowler Yamin Ahmadzai, who gave Afghanistan their first Test scalp after getting Dhawan out early in the second session, led the attack with two wickets.
Hardik Pandya, on 10, and Ravichandran Ashwin, on 7, were at the crease when play ended after an extended final session but only 78 overs were possible due to two rain interruptions.
Afghan skipper Asghar Stanikzai called it a "very proud moment" as he strode onto the field for the toss with opposite number Ajinkya Rahane.
"All the guys have first-class experience. Inshallah (God willing), we can do well," the 30-year-old batsman said.
Afghanistan have become one of only 12 nations sanctioned to play Tests, the five-day format considered cricket's peak, after defying heavy odds to emerge as a force in the game.
But soon the rookies realised they were up against the world's top Test side as Dhawan galloped to his century in just 87 deliveries, becoming the first Indian batsman to reach three figures on the opening day before lunch.
Dhawan hit 19 fours and three sixes as he set about the Afghan bowlers including spin sensation Rashid Khan, smashing three boundaries in the teenager's opening over to bring up his 50.
Vijay then took control after Dhawan's departure, putting together a 112-run second-wicket partnership with Lokesh Rahul who made 54.
Ahmadzai bowled Rahul, who dragged a delivery on to his stumps, and Wafadar trapped Vijay lbw to lift Afghan spirits.
Khan, who gave away 120 runs in 26 overs, then combined with fellow spinner Mujeeb Ur Rahman as the pair got a wicket each of Rahane and Cheteshwar Pujara to pull things back.
Most cricket-loving Afghans were watching the match on TV back home as they prepared for a three-day public holiday marking the Muslim festival of Eid.
Earlier, Afghan President Ashraf Ghani sent his congratulations for what he called a "historic day".
"I am proud of the men who championed cricket in Afghanistan in the dawn of the century and believed in themselves that one day Afghanistan will play against the best in the world," he said.
SCORES IN BRIEF
INDIA: 347 for 6 (Vijay 105, Dhawan 107, Rahul 54, Pujara 35; Ahmadzai 2-32)
AFGHANISTAN: Stanikzai (captain), Shahzad, Ahmadi, Shah, Zazai, Nabi, Shahidi, Rashid, Mujeebur, Ahmadzai, Wafadar.