Stokes had led a charmed life on the fourth evening, but produced a towering knock in pressurised circumstances as he turned his overnight score of 16 not out into an unbeaten 115.
Resuming on 96 for four, England leant on Stokes' seventh Test hundred to reach 258 for five before captain Joe Root waved his men in just before 3.30pm.
Jos Buttler (31) was the only man to fall, top-edging Pat Cummins, with Jonny Bairstow powering his way to a quick 30 in the afternoon session.
But the day belonged to Stokes on the same ground that his brilliance with the bat helped deliver England's World Cup success a month ago. He struck 11 fours and three sixes in all, motoring from 51 to 100 in just 48 balls after lunch.