The 87-year-old queen clapped and smiled broadly in the stands as Estimate, the 7-2 favourite, crossed the line to become the first filly to win the Gold Cup since Indian Queen in 1991.
The queen, who has been on the throne for 61 years, has attended Ascot every year since 1945. Thursday's win was her 22nd overall at Ascot, but the first in the signature Gold Cup.
"It's a great honour to win for Her Majesty the Queen," Estimate's trainer, Michael Stoute, said. "We know how much she loves this game."
Estimate won at Ascot last year in the Queen's Vase, one of the races in which the queen presents the trophy. She received the prize then from her husband, Prince Phillip.
With Phillip recovering from abdominal surgery, the queen, sporting a lilac outfit, received the Gold Cup trophy Thursday from one of her sons, Prince Andrew.
British Prime Minister David Cameron congratulated the queen on Twitter.
"Huge congratulations to Her Majesty for Estimate's victory at Royal #Ascot - first time ever a reigning monarch's horse has won the Gold Cup," he wrote.
Jockey Ryan Moore rode Estimate to a close victory over 5-1 shot Simenon in the race, which is run over 2 miles and 4 furlongs. Challenger Top Trip, 7-1, finished third.
Estimate held off a late challenge mounted by Simenon's jockey Johnny Murtagh and won by a neck.
"It's fantastic to win for the queen at Royal Ascot," Moore said. "We had a good draw and the pace wasn't mad at the beginning. She (Estimate) relaxed so well over the final furlongs."
Despite the bookies making Estimate the favourite, Stoute had raised doubts about the filly's form before the race.
"I really felt it was a tough task I wasn't confident at all taking on the boys, but it's a great thrill," he said. "She's a pain in the backside at times though."
Riposte, trained by Jane Cecil, the widow of celebrated trainer Henry Cecil, who died earlier this month, claimed victory in the Ribblesdale Stakes ahead of Just Pretending and Elik.
The win was greeted by loud cheers. Henry Cecil trained a record of 75 winners at Ascot.
"I don't really have the words to say what I am feeling right now. I think people will probably have a good idea," Jane Cecil said. "Henry was just adored by so many people. People who had never met him just loved him."