England, who were facing an early defeat after two days of the match, made a massive 570 for seven declared in their second innings, setting South Africa an improbable target of 378 to win.
South Africa were 21 for one at the close after Matthew Hoggard trapped South African captain Graeme Smith leg before wicket for five.
Thorpe, who made an unbeaten 118, said: "You have to look at the psychology of this match. On the first day we were down, if not quite out, and we knew we had to do something very special to get back on terms. I think we've done that, and the pendulum has swung back in our favour."
Thorpe said the character of the team had shown through during his century partnerships with Andrew Flintoff (60) and Geraint Jones (73).
"Someone needed to put their hands up. It was great to see the character of the team come through," said the batsman.
The loss of Smith completed a dismal day for South Africa, who saw their chances of victory disappear as England piled on the runs under a blazing sun. Rookie fast bowler Dale Steyn claimed, however, that the hosts had not given up hope.
"There's a good vibe in the dressing room," said Steyn.
"We want to go out there and win tomorrow. It was a good declaration; perhaps it's 30-40 runs more than we would have liked, but we're going to go for it."
It seemed a forlorn hope, though, after Thorpe led the way as England continued a remarkable fightback which was started when Marcus Trescothick and Andrew Strauss put on 273 for the first wicket Tuesday.
South Africa's bowlers struck three early blows Wednesday and the match was evenly poised before Thorpe and Flintoff put on 114 for the fifth wicket.
The partnership put England on top for the first time in the match. The tourists, who lead the five-Test series 1-0, were bowled out for 139 on the first day and trailed by 193 runs on the first innings.
Thorpe and Jones then punished a tiring South African attack as they put on 132 for the sixth wicket, scoring at a run a minute.