Stokes (117no) and Matt Prior continued the tourists' belated defiance on a pitch full of crazy-paving cracks, in the third Test of a series they already trail 2-0.
Even on a lunchtime 332 for six, in notional pursuit of a world-record 504 to win or in the hope of eking out their remaining wickets for two more sessions, England were long odds-on favourites to lose here and therefore concede the Ashes.
Stokes, however, was determined to go down fighting in only his second Test and was justly rewarded with a memorable and chanceless century.
The 22-year-old left-hander played admirably straight throughout, and struck the ball powerfully off either foot, both on the fourth evening with Ian Bell and Prior then and again through a taxing morning.
Prior was gone by the time Stokes reached his hundred, with a hook fine off Mitchell Johnson for his 16th four from the 159th ball he faced.
It was to Stokes and Prior's great credit that they had come through the first hour, with much skill and plenty of luck essential too as Australia bowled especially well and honed in on the myriad cracks with the old ball.
Both players therefore played and missed plenty, but kept out the straight ones and cashed in on the rare occasion of anything loose.
Stokes was into the 90s by the time the second new ball was taken, and immediately Harris hit a crack which - not for the first time - diverted the delivery at an impossible angle, but mercifully wide of off stump.
The sixth-wicket pair had put on 76 when Prior played only his second false shot of the morning, and paid for it, edging Johnson behind as he aimed to hit some width on the up past point.
But Tim Bresnan, who batted better than most in England's faulty first innings, accompanied Stokes past his century and to lunch.