Rafael Nadal battled back from a set and a break down to claim the biggest title since his return from injury with a 4-6 6-3 6-4 victory over Juan Martin Del Potro in the BNP Paribas Open final.
Fifth seed Nadal spent seven months on the sidelines because of his ongoing knee problems but has been in impressive form since his return, winning two titles from three finals before Indian Wells.
And he extended that to three with his biggest win of the year, slowly asserting his superiority until he dominated the final set to seal his record 22nd Masters title - passing Roger Federer's haul of 21.
"It's probably one of the most emotional victories of my career," Nadal said in the post-match presentation ceremony, broadcast on Sky Sports 2.
"The support since I came back has been huge. It's an unforgettable week for me and an unforgettable tournament."
If there were any doubts that the Spaniard would get back to his best following his knee troubles, he has dispelled them this week with victories over Del Potro, Tomas Berdych and, in particular, a quarter-final triumph over Federer.
His rewards, on top of the trophy and prize money, will be a return to the top four ahead of compatriot David Ferrer, and a rest - he has decided not to play in the upcoming tournament in Miami.
When Nadal took a 3-0 lead in the first set, breaking seventh seed Del Potro at the fourth attempt in game two, it seemed like it could be a formality.
But Del Potro, who beat Andy Murray and Novak Djokovic on his way to the final, stormed back, taking eight of the next nine games to take the set and go 2-0 up in the second.
Again, though, the man who broke first in the set could not hold his advantage and a run of five straight games for the Spaniard ensured the match was squared at 1-1.
Nadal jumped all over Del Potro at the start of the third, creating a raft of break-point chances as the pair traded huge groundstrokes and converting at the fourth attempt in game three.
At 15-30 in the next game, De Potro looked set to bring up two break points of his own, but some astonishing defence from Nadal won him the point and he took the game for a 3-1 lead.
Del Potro saved three match points on serve at 5-3 to force his opponent to serve it out, but it was only delaying the inevitable and he pulled a forehand into the tramlines in the next game to give Nadal the title.
In the women's draw, Maria Sharapova claimed her first title of the year after sweeping aside Caroline Wozniacki in straight sets.
Sharapova was a beaten finalist in Indian Wells last year, going down 6-2 6-3 to Victoria Azarenka, but she went one better this time after defeating Wozniacki 6-2 6-2 in one hour and 21 minutes.
The victory means the 25-year-old second seed lifted the title, the 28th WTA singles crown of her career, without dropping a set in the tournament.
In the match between two former world number ones and former champions here - Sharapova winning in 2006 and Wozniacki claiming the title in 2011 - it was the Russian who was quickly into the ascendancy and she never looked back.
She broke Wozniacki in the first game of the match and then broke for a second time to make it 5-2 before serving out for the opening set.
Wozniacki failed to make the most of either of her two break points in that set, and she did not manage a single one in the second as Sharapova continued to dominate.
The world number three again broke Wozniacki immediately and, although the Dane battled hard as she did in the semi-final when she fought back 2-6 0-2 down to beat Angelique Kerber, Sharapova was not to be denied and once again she broke in the seventh game before holding serve to claim the title.