Frankie Dettori opened his account at the Royal meeting when Rewilding claimed the red-hot favourite So You Think close home in the Prince of Wales's Stakes.
Everything seemed to be going to plan for Aidan O'Brien's So You Think as he took over at the head of affairs from his pacemaking stablemate Jan Vermeer turning into the straight.
He was three lengths clear at one stage but Rewilding, trained by Mahmood Al Zarooni, was catching with every stride.
Dettori was in full flow by now and there seemed a sense of inevitability that the Ascot specialist would get up in the highlight of the second day.
There appeared to be no excuses for So You Think and Ryan Moore was in the perfect position throughout, but he had no reply to Rewilding's relentless late burst, going down by a neck.
Rewilding (17-2) had finished third in the Derby but was an expensive failure in the St Leger at Doncaster.
Next seen in the Dubai Sheema Classic, the four-year-old beat a high-class field in fine style there but was expected to improve for his European reappearance over a trip short of his best.
The fast early pace suited him down to the ground as he brought the perfect European record of Aussie import So You Think (4-11) to an end.
Dettori said: "I have to say the second never gave up. It was a tremendous gallop with two great horses.
"When I got past him it was sheer joy. It was sheer joy to be in the race.
"I'm delighted for Rewilding as he doesn't get the recognition he deserves. He's a very good horse and he showed his true colours today.
"They are two great teams (Ballydoyle and Godolphin) and we put our life and soul into the job and into the sport.
"This is what we are here for - to ride these kind of finishes in great races."
Godolphin supremo Sheikh Mohammed said: "I'm very satisfied. These are the races you always wait for and when you win, it is a great thing."
Al Zarooni gave the ruler of Dubai full credit, saying: "I have to be honest, it is not me, it's him.
"He always gives us instructions on how to deal with horses. From training them, to feeding them and everything.
"It was his Highness' decision (to drop back in trip). We are still learning and he has been racing in England for a long time - more than 30 years."
Godolphin racing manager Simon Crisford added: "He needs to be fresh and we'll have to talk to Sheikh Mohammed, but you'd look to coming back here for the King George.
"There are lots of options for later, including the Champion Stakes."
O'Brien said: "I will take responsibility for this personally.
"After he won his first two races so easily I had gone easy on him.
"It was a big step up on his last two races. He ran keen for the first two furlongs with Ryan and it was a strong-run race. He went and won his race but just got very tired in the last half a furlong.
"Frankie gave his horse a beautiful ride, on a horse that stays a mile and a half well, he just came and got him in the last 50 yards.
"I think it was trainer error, I didn't have him fit enough for this kind of race and he's given a good blow afterwards.
"I would think there's improvement to come.
"Something like the Eclipse is a definite possible but like always we hadn't looked beyond today."
Moore said: "He was a bit gassy for the first two furlongs and when I asked him to pick up, he didn't quite pick up as I expected."
Third home was Sri Putra and his trainer Roger Varian said: "We are thrilled. A race like that brings out the best in him - a strongly-run 10 furlongs on a stiff track.
"He's done enough to warrant another go at the Eclipse. He ran a great race in it last year."