It was enough of a fairytale that Khadijah Mellah was even lining up in Goodwood's Magnolia Cup charity race. For her to win it took the story to another level altogether.
The 18-year-old student from Peckham in South London - the first hijab-wearing Muslim to ride on a British racecourse - beat the likes of Olympian Victoria Pendleton and model Vogue Williams on the biggest day of her sporting life - to the delight of a huge Goodwood crowd.
Khadijah, who has just finished her A-Levels and is set to study mechanical engineering at university in September, learnt to ride at the charity Ebony Horse Club in Brixton but only sat on a racehorse for the first time in April. But it doesn't look like this will have been her first and last race.
Her journey from South East London to Goodwood, for the ladies-only charity horse race, will be the subject of a documentary called Riding a Dream which will air in the autumn.
Since the end of her A-Levels and Ramadan, Khadijah has been based in Newmarket as part of her preparation for the race. And those preparations, under the watchful eyes of trainer Charlie Fellowes and jockey Hayley Turner, paid off as she got her horse Haverland home first.
She became the first woman to ride competitively on a British racecourse while wearing the hijab, but it might not be her last, for she subsequently revealed she wants to gain an amateur riders' licence.
Riding quietly in mid-division among the 12 runners, and coping with the speed generated down Goodwood's five-furlong downhill straight, Mellah gave Haverland a well-timed run to score narrowly from Land Filly, ridden by Alexis Green, and Clewbrious Company, the mount of Rachael Gowland.
Mellah, whose introduction to the Brixton charity Ebony Horse Club enabled her to begin riding lessons, started riding with Newmarket-based Fellowes six weeks ago.
She said: "There are no words to describe this - I'm lost for words. I'm still trying to figure out how it all happened, and I'm so grateful to everyone who has come along to support. I'm so happy that Haverland is well - I've been riding him a lot at Charlie's and I love him so much.
"I wasn't used to seeing so many people, and there were so many cameras and people looking for information. At the start it was dead silent, and I wanted people [other riders] to start talking. I thought 'Oh my god', would someone smile, please. I didn't really know what I was doing. It was crazy.
"When we set off there were three horses in front of me and the kickback was flying in my face and I decided to pull out and see what happens. When I passed the post I couldn't believe it, and then I saw all my family and friends and started crying. I am quite competitive, so I wanted to win this race, but I never expected to.
"Initially, riding out at Charlie Fellowes' yard was quite difficult because it was such a new experience, but Charlie, and Chris Wall and all the trainers I've ridden out with have been amazing in helping me. I didn't really know how to ride, and Charlie has been so amazing, I can't thank him enough.
"Horses bring me immeasurable amounts of happiness. I've always loved them and always will and I hope to carry on and keep riding."
Surrounded by friends and instructors from the Ebony Horse Club, she said: "I've known some of these people for five or six years and they have watched me grow up, so for them to be here is wonderful, especially Naomi, who has been my instructor. I'm just shocked.
"Ambitious women can make it - that's all I want to represent. Be ambitious and do it. I've had so much support, and I can't wait to see other stories about women who achieve something."