Stablemate Rerouted had set off like a hare in the one-mile feature race on the first day of the famous meeting.
Queally decided to let the hot favourite make his move and he surged into a lead as the Ascot crowd roared their approval on a sun-kissed day.
It initially appeared as though the horse, who won the Guineas by six lengths, would secure another comfortable triumph.
But having been out on his own for much of the race, Zoffany and Excelebration were among the challengers to make their move.
Frankel dug deep to land the Group One prize, but it was not the procession many racing fans had forecast.
Queally insisted the three-year-old was not tiring after taking up the running so early, explaining: "He was starting to get a bit fed up of it at the front.
Frankel 'knew race was won'
He added: "He's more versatile than people think and he's still the one to beat at the moment."
Sir Henry backed up Queally's claims, saying of the unbeaten colt: "He had the race won and thought he'd done enough."
The trainer admitted it was "inevitable" Frankel would race against
and Goldikova at some point after the duo fought out a thrilling Queen Anne Stakes in the opening race of the meeting.
Canford Cliffs, an 11-8 shot, powered past last year's winner in the final furlong to win by a length, with Cityscape third.
Cape Blanco set the early pace before Goldikova made her move two furlongs out, but she did not have enough in the tank to hold off Canford Cliffs.
"He is an amazing horse," said winning jockey Richard Hughes.
"I'm sure whatever horse you put in front of him, he'd go by them. He is the best horse I have ever ridden."
Canford Cliffs denied French mare Goldikova, who went off at 5-4, her 14th Group One victory.
Canford Cliffs upsets Goldikova at Ascot
A fine late ride by Jim Crowley on
took the honours in the second race of the day, the King's Stand Stakes.
The Robert Cowell-trained six-year-old, backed from 14s into sevens, was produced from the pack inside the final furlong, holding off another late charge from the favourite Star Witness, with Sweet Sanette third.
The Coventry Stakes saw another thriller, as 4-1 favourite
enjoyed a ding-dong battle with Roman Soldier before surging ahead as they approached the line, with St Barths third.
Eddie Ahern rode an unscheduled winner on
in the Ascot Stakes - after Kieren Fallon pulled out with a neck problem that required treatment - while Jonny Murtagh nicked the Windsor Castle Stakes on
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.