Raffle Prize, right, and Dettori edge home (PA)
A maiden winner at Chester last time out, Raffle Prize was sent off an 18-1 chance for trainer Mark Johnston, and Dettori settled her in the pack as American raider Kimari took up a prominent early position.
The Wesley Ward-trained Kimari was in front with two of the five furlongs left to run, but Raffle Prize was just starting her move and swept through to edge into the lead.
While Kimari battled all the way to the line for John Velazquez, she could not get back in front, with Raffle Prize prevailing by a head to give the jubilant Dettori a 61st winner at the Royal meeting
Final Song, the 6-1 favourite, had to settle for third.
The race was run in steady rain, and a bedraggled Dettori said: "When I saw Wesley's horse upsides, I thought oh my God, he's a good friend of mine, if I beat him, he will go crazy!
"My filly was very brave. She jumped good and I knew she had won over six furlongs, so when I saw Wesley's filly I decided to take her on early. The other filly [Kimari] had only run over four and a half furlongs.
"I knew that if it was a test of stamina she would give in sooner or later and in the final 200 metres I saw her stride start to shorten. I knew I had her."
Johnston, saddling his 44th winner at Royal
Ascot and first of the week, said: "Raffle Prize did it well today. People always ask you in the build-up to Royal Ascot about what your chances are at the Royal Meeting.
"However, you can never know your chance, particularly in these two-year-old races where most of the field are effectively maiden winners. There is nothing in the race with a great deal of form to go on.
"All you can do is run your best horses at the right time. Coming into Royal Ascot, we thought she deserved to be here, but you don't know how good your horses are going to be in relation to the others.
"We thought we had a great chance and I'm delighted she has won. No disrespect to Lester Piggott, but is Frankie Dettori not just the greatest jockey?
"He gave the horse a fantastic ride by tracking Wesley Ward's horse (Kimari) and he was so relaxed and confident - we could not have been in a better position in the race and you know you've got the right man on board for the last 100 yards too.
"We had some doubts about coming back to five furlongs with Raffle Prize because we weren't sure if she could mix it in a Queen
Mary over this trip, but she did it well.
"We haven't looked beyond this and for any owner of a filly, the Queen Mary is the number one two-year-old race because everyone wants a Queen Mary winning broodmare - anything beyond this is a bonus."