O’Keefe produced a career-best 6-35 run figures as India lost seven wickets for 35 runs in 15.1 overs in the sensational post-lunch session and were dismissed for 105 runs to hand the visitors a crucial lead of 155 runs.
After being shot out for a paltry total, India hit back immediately through off-spinner Ravichandran Ashwin, who dismissed openers David Warner and Shaun Marsh in quick time.
Australia, who made 260 in their first innings, advanced to 46 for 2 in the second to an overall lead of 201 on a venomous pitch at the Maharashtra Cricket Association Stadium.
Match Score Card India vs Australia first Test, Day 2
Here are the live updates
# Day 2: Stumps - Australia lead by 298 runs
# Visitors take firm control as lead nears 300 on Day 2,
# Jayant Yadav to Renshaw, out Caught by Ishant!! Renshaw literally his hand on the head, not quite believing what he's done. Renshaw c Ishant b Jayant Yadav 31
# Renshaw survives
#Renshaw was given out LBW by Jadeja but in review the decision was changed
#P Handscomb (19) is out, c Murali Vijay b Ravichandran Ashwin
#Play resumes after tea
#Aus 46/2 in second innings at Tea
#Ashwin to Shaun Marsh, out Lbw! Wickets continue to tumble
#India's spin duo attacking Australian batsmen
#Ashwin strikes early by geeting Warner out
#Australia innings starts
#Host all out on 105, O'Keefe claims 6 wickets
#O'Keefe to Jadeja, out Caught by Starc!! Five wickets for O'Keefe
#J Yadav (2) is out, st Matthew Wade b Steve O'Keefe, 98/8
#Lyon to Ashwin, out Caught by Handscomb It is an amazing performance from Australia
#O'Keefe to Saha, out Caught by Smith, india in big trouble
#O'Keefe to Rahane, out Caught by Handscomb
#K L Rahul is out on 64, c David Warner b Steve O'Keefe, 94/4
#K L Rahul brings up his 2nd Test 50 and leads India's reply
# K L Rahul scores half century
#At lunch, India are 70/3, trailing Australia by 190 runs in first innings
# K L Rahul getting closer to half century
#Rahane comes out to bat
#India is in spot of bother after loosing skipper kohli
# Handscomb took Kohli's catch at first slip
#Virat Kholi chases a wide ball and edges it to Smith at slip, OUT for 0
#Starc strikes and Pujara is the second wicket to fall, OUT for 6
#Pujara, Rahul developing partnership after early departure of M Vijay
#J Hazlewood to C Pujara (5), 4 runs
#Cheteshwar Pujara comes out to bat
M Vijay (10) is out, c Matthew Wade b Josh Hazlewood
#India begins their innings with opener K L Rahul and Murali Vijay
#Australia all out for 260
#Ashwin to Starc, out Caught by Jadeja!! Five balls it has taken India to get Starc out
#R Ashwin to M Starc (61), 4 runs, 260/9