
Top fancies Benbatl, Recoletos and Rhododendron failed to fire.
Accidental Agent finished sixth behind Rhododendron and Lightning Spear in the Group I Lockinge Stakes at his previous start and was winning at stakes level for the first time.
A four-year-old son of Dansili sire Delegator, he was bred by trainer Eve Johnson Houghton's mother and is the longest priced winner of the Queen Anne Stakes in history.
He is also the first Royal winner for trainer and jockey.
"I thought I was tilting at windmills and I dreamt about being third," Eve Johnson Houghton told the Sporting Life.
"I thought 'my god, I'm going to be placed' - there was an awful lot of screaming going on.
"It's just ridiculous. I have all my cousins and brothers and my mum here - I don't think she's ever going to get over it."
Accidental Agent has won five of 14 starts and is the only foal to race from Roodle, a half-sister by Xaar to Group II winner Prize Exhibit.
"Accidental Agent loves Ascot and he did have a chance. He takes so much getting ready and getting fit. I knew he wasn't fit first time and then he had a tiny setback before the Lockinge so we couldn't get as much work into him as I wanted," his trainer added.
Accidental Agent is the second stakes-winner for his sire Delegator, a Group II winning son of Dansili that died prematurely at age 10 two years ago.