CNN  — 

Hayley Turner became only the second female jockey to ride a winner at Royal Ascot after her mount edged out Queen Elizabeth II’s horse to win the Sandringham Stakes Friday.

The 36-year-old Turner, who came out of retirement last year, produced a masterclass in a nail-biting finish to end a 32-year wait for a female winner at the prestigious meeting.

Turner and her mount Thanks Be denied the Queen a 24th winner at Royal Ascot after holding off her Magnetic Charm at the line.

The only other woman to ride a winner at Royal Ascot was Gay Kelleway in 1987.

“The girl’s changing room is full now so it was only a matter of time,” Turner told ITV Racing.

“The standard of girl jockeys has risen so much since I started riding. They’re so competitive.”

READ: The Queen shares Frankie fever as Dettori lights up Royal Ascot

READ: Royal Ascot: A day in the life

Hayley Turner and Thanks Be edge The Queen's Majestic Charm to win at Royal Ascot.

Royal Ascot has been treated to a wonderful week of racing – notably veteran jockey Frankie Dettori’s four straight winners culminating in the Gold Cup on Ladies’ Day – and this was yet another highlight.

The popular Turner has been a pioneer for female jockeys, and notched more than 750 career wins before retiring from the sport in 2015.

However, after a stint as a TV racing pundit she returned in 2018, and her smiles after the race were greeted with raucous cheers from the bumper crowd.

“Hayley rang me up two weeks ago and said, ‘Can I ride out for you a couple of days a week?,’” said winning trainer Charlie Fellowes.

“That’s how she got this ride. She’s a very, very good rider. I’m just so pleased for her and everyone involved. It’s a huge win.”

Earlier this year, Bryony Frost became the first female jockey to win a top-flight race on an inspirational day at the Cheltenham Festival.