Lehmann, 48, told a press conference on the eve of the match: "This will be my last Test as head coach of the Australian cricket team. Saying goodbye to the players was the toughest thing I have ever had to do."
The Test begins on Friday at the New Wanderers stadium in Johannesburg. The hosts lead the four match series 2-1 after thrashing the tourists by 322 runs in the third Test which was ultimately overshadowed by the Australia team's ball-tampering plot.
Lehmann was cleared of any role in the cheating but skipper Steve Smith and David Warner were sacked as captain and vice-captain respectively. They were both banned for one year from international and domestic cricket while batsman Cameron Bancroft was suspended for nine months for his part in the shenanigans.
A few hours before Lehmann's announcement, the sport's ruling body, the International Cricket Council (ICC), said it would review its rules on punishing ball-tampering.
Current guidelines stipulate that anyone found guilty can be fined their entire match fee and banned for one Test. However the ICC top brass say a crackdown is essential to maintain confidence in the game.
"We've come to realise that the world - not only Australia - regards ball-tampering in a very serious light," said ICC chief executive David Richardson. "It goes to the spirit of the game.
"We need to look at the penalty imposed, specific to ball-tampering. Around the world, ball-tampering is considered cheating. The reaction all around the world shows us that if we neglect the way the game is played, cricket is itself in danger."
Richardson, a former South African wicketkeeper, conceded that recurrent bad behaviour had sullied the image of the sport in recent weeks including incidents of sledging, dissent against umpires' decisions and finally the ball-tampering episode.
"This has been perhaps one of the worst periods in recent memory for consistently poor player behaviour," he wrote in a blog post on the ICC website. "And the global outcry in relation to the ball-tampering is a clear message to cricket: enough is enough.
"The spirit of cricket is precious to our sport and so intrinsically linked with good behaviour. The turn of phrase: 'That's just not cricket' is not an accident. We must protect that spirit."