Roger Federer beat Andre Agassi 4-6 6-3 6-4 to reach the final of the Indian Wells Master Series tournament.
The American claimed the opening set as Federer started sluggishly in hot and sunny conditions in California.
Federer responded by taking the second set, breaking Agassi in the second game as he switched tactics and began to dominate at the net.
Agassi battled back but shot long to hand Federer the break in the ninth game and he served out the match.
Federer will now face British number one Tim Henman in the final - their head-to-head record is 6-1 in Henman's favour.
The world number one recorded his third straight victory over Agassi.
But Federer got off to a shaky start, committing 12 unforced errors to hand the opening set to the American baseliner.
The Swiss fought back to take the second but he was forced to dig deep to stave off the break on his own serve.
Federer again survived two break points in the eighth game of the decider before Agassi mis-hit a forehand to put the Swiss 5-4 ahead.
The Wimbledon champion held serve to advance to his third final of the season but admitted it was a struggle.
"I just kind of hung in there," said Federer.
"I served pretty well. It was important for me not to get my serve broken early on."