Opening batsman Markram made 85 not out as South Africa reached 167 for five at tea, a distant 250 runs short of an improbable target of 417.
Markram and Theunis de Bruyn, South Africa's two least experienced batsmen, held up the Australians for almost two hours in a fifth wicket stand of 87 after coming together at 49 for four.
De Bruyn, playing in his fourth Test, made a stylish 36 before he was caught behind off Josh Hazlewood. It was the only wicket to fall during the afternoon.
Markram and Elgar put on 29 for the first wicket before Elgar edged a sharply lifting delivery from Mitchell Starc to wicketkeeper Tim Paine to be out for nine.
Amla avoided a pair but only made eight before he was leg before wicket to Hazlewood.
South Africa then suffered a hammer blow when De Villiers, their top scorer in the first innings, was run out for nought.
Markram turned a ball from off-spinner Nathan Lyon behind square leg and did not respond when De Villiers called him through for a run. De Villiers had to turn and tried to go back but could not beat David Warner's throw to Lyon.
Markram, in his seventh Test, showed good composure, a sound technique and some cracking off side drives in a 147-ball innings which included 11 boundaries.
Earlier, Australia added 14 runs to their overnight total of 213 for nine before being bowled out for 227.
Disclaimer: No Business Standard Journalist was involved in creation of this content
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
