Juan Martin del Potro ended world number one Roger Federer's 17-match unbeaten run to claim the BNP Paribas Open title at Indian Wells.
The eighth-ranked Argentine beat the Swiss 6-4 6-7 (8-10) 7-6 (7-2) in a thrilling encounter.
Federer had been searching for a record sixth title in California, but it was Del Potro who powered to his first ATP Masters 1000 title.
He is the first player to beat Federer in 2018.
Del Potro saved three match points before closing out victory in two hours 42 minutes.
The 29-year-old has been hampered by wrist problems in recent years and has had three operations which left him struggling to use his backhand.
But he has made a strong start to 2018, winning his first ATP 500 title for five years at Acapulco earlier in March and returning to the world's top 10.
The Argentine forced the only break of the first set and made just three unforced errors to Federer's 11 as he closed out the first set in 39 minutes.
Federer faced break points in the opening game of the second set but an emphatic forehand forced deuce, before the Swiss served his way out of trouble.
He created two set points on Del Potro's serve but the Argentine drew the errors out of the Federer forehand to take the set to a tie-break.
Cheered on by the crowd, Federer thought he had forced a deciding set with a serve out wide, but a Del Potro challenge showed it to be out and the Swiss then double faulted for 6-6.
Federer had to save a championship point after some superb, quick serves from Del Potro and then finally closed out the set on his fifth attempt.
Del Potro complained to the umpire at the changeover about the noise from a crowd that was largely supporting Federer in an increasingly feisty encounter.
It was Federer who broke first in a tight final set to serve for the match but Del Potro saved two championship points and thrashed a forehand through the Swiss to put the match back on serve at 5-5.
Both players held serve for a decisive tie-break but a combination of loose serving from Federer and some powerful returns from Del Potro saw the Argentine secure victory at the third attempt.
"It's difficult to describe with words. It's like a dream," Del Potro said.
"After all my problems, after all my surgeries, I couldn't believe I'm here winning a Masters 1000 and beating Roger. It's amazing."
BBC tennis correspondent Russell Fuller
Having had a championship point of his own in the second set tie-break, which Federer clinched on his seventh set point, there looked no way back for Del Potro when he lost his serve deep in the deciding set.
Federer, serving for the title, moved 40-15 up. But Del Potro saved three championship points of his own and then ran away with the tie-break as the world number one twice double-faulted.
The tennis was thrilling, and the pot boiled throughout with umpire Fergus Murphy blamed heatedly by both players, almost in rotation.
Del Potro did not think the Irishman intervened enough to reprimand the small number of fans who applauded his missed first serves. Federer thought he did do so too frequently, and also vented his frustration at line calls.
Like Federer, Del Potro now has 17 wins to his name this season. He may not have won a Grand Slam in that time, but can point to an identical record of two titles and a runners-up spot.