Australia scored 294 for eight to win by two wickets and earn their first series whitewash in South Africa.
Langer was concussed by the first ball of Australia's first innings, a bouncer from Makhaya Ntini, and was considered unlikely to bat in the second innings of his 100th Test.
But when Australia were reduced to 275 for eight in search of their target of 292 the opener took matters into his own hands.
''When we got down to about 10 runs to win Justin took it upon himself to put the pads on,'' Australian captain Ricky Ponting told a news conference.
''That's after addressing the group this morning before our warm-up and saying that he couldn't bat and wasn't going to bat.
''But when it got a bit tight with the Test match on the line, he had the pads on.
''He had his chest guard on, he had his forearm guard on, he had his helmet on, and he was pretty keen to get out there.'' Ponting said Langer would only have batted under strict conditions.
''He was probably only ever going to go out there if he could stand at the non-striker's end,'' Ponting said.
''We couldn't risk or afford him having to face any deliveries.
''Medically over the last couple of days his situation hasn't changed. It was going to take me and probably a few other blokes to keep him in the dressing room if it had got down to that.'' Ponting was at a loss to explain what he would have done had Langer insisted on batting.
''To tell the truth I don't know what I would have done,'' said the captain.
''If we needed two to win and he had to go out and be on strike I was probably going to have to declare or do something like that, which would have been pretty hard.
''He said to me then he wouldn't have spoken to me ever again as long as he was alive.
''If it comes to that again, I am just going to have to knock him out.'' Damien Martyn steered Australia towards their victory by top-scoring with 101 in the second innings.
''It was great to see Damien play the way he did,'' Ponting said of a batsman whose Test future had been in question.
''That was just an absolute class innings in those conditions, it was probably his best-ever Test innings.'' Australia won five of the six Tests the teams have contested this season, with the other drawn.
''Some of the Test matches have been closely fought but I'm not sure if South Africa have really got themselves in too many winning situations,'' Ponting said.
''We've been the ones who have dictated the Test matches. ''I don't think South Africa have deserved to win any.'' Australia resumed on 248 for six and Jacques Kallis, who captained the home side in the absence of the injured Graeme Smith, said South Africa never lost hope of winning the third Test.
''We arrived this morning really believing we could win it, obviously we needed a few things to go our way,'' Kallis told a news conference.
''They came out and played aggressively, but even with a couple of runs to go we still thought we had a chance of knocking them over.'' Australia start a two-match Test series in Bangladesh on Sunday, while New Zealand arrive in South Africa on Wednesday to play three Tests.