Jockey Adam Kirby won the Derby at Epsom on 16-1 shot Adayar just two days after being replaced on another leading contender by Frankie Dettori.
Kirby guided the winner, for Godolphin trainer Charlie Appleby, to victory by four and a half lengths from 50-1 chance Mojo Star, with Hurricane Lane in third.
The jockey had been set to ride John Leeper before Dettori was called up.
Kirby said: "This is the Derby lads - get in there!"
Ben Curtis' Gear Up had led the race but, just after turning on to the straight, Kirby sneaked Adayar down the inside to give trainer Appleby his second Derby winner, after Masar in 2018.
Bolshoi Ballet, the pre-race favourite, never looked like mounting a challenge and was unplaced.
On losing his original mount, Kirby said: "I just thought 'don't be bitter, be better', and it's worked out great.
"There are ups and downs, there are swings and roundabouts, but I can't thank Charlie Appleby enough. He is a true gentleman and a great trainer. The Appleby team are second to none.
"I've always said I'd rather win a Derby than be champion jockey. I think it's the greatest race."
- Full result of the Cazoo Derby
- The Oaks: Frankie Dettori rides Snowfall to record victory
- Remarkable story of tipster Prince Monolulu
Asked about Adayar racing clear after sticking to the inside rail, Kirby added: "I had no choice."
Kirby replaced champion jockey Oisin Murphy on Adayar, a son of the legendary racehorse Frankel, after Dettori's call-up.
"We saw the trials and tribulations in the build-up, but I'm delighted for Adam, it was a fantastic ride," said trainer Appleby.
"It's something that every jockey wants to achieve and he was hungry for it.
"Adam probably knows this horse better than most - he broke him in."
Kirby is used to springing a surprise, having ridden the biggest-priced winner in Royal Ascot history when triumphing on 150-1 outsider Nando Parrado last summer.
Four years earlier, he enjoyed a Group One double at the Royal meeting on Profitable and My Dream Boat within 24 hours of his partner Megan giving birth to their son.