The Scot coasted through the final four-stage run on loose gravel to finish 12.3sec ahead of the Spaniard Carlos Sainz in his Toyota. Didier Auriol of France was third.
"We thought we'd got enough in hand," said McRae, the overnight leader. "But we couldn't afford to take it easy on the final day. The road surface is covered in loose gravel which we swept away for the cars behind. We knew they'd be going faster than us and so we just had to hang on and hope for the best."
McRae, world champion in 1995, won the Safari Rally last month after being disqualified from his third place in the opening rally of the season in Monte Carlo because of an illegal water pump on his new car.
The victory moved the Scot within reach of the championship leader, Tommi Makinen of Finland, who finished fifth in his Mitsubishi. McRae now has 20 points and Makinen 22.
Makinen, the world champion, had an excellent final day, winning the first three stages of the third leg before finishing third on the final run. But he was unable to improve on his overnight position and finished more than a minute behind McRae.Reuse content