By Martyn Herman

RIO DE JANEIRO (Reuters) - An ambition he scrawled on a wall of the family garage as bike-mad teenager was realized by American Connor Fields on Friday as he won the gold medal in the Olympic BMX competition.

In fact, he even surpassed it with a stunning ride at Rio's spectacular X-Park, surging to victory after trailing teammate Nicholas Long out of the start gate.

"I'm going back next week and I'll help my dad move some stuff around in the garage, there's still a Sharpie (marker pen) in there that says 'One day I will be national and world champion'

"I can't wait to take a photo of myself next to it with the medal. If only my 14-year-old self could see this now."

Fields, 24 next month, suffered disappointment four years ago in London when, after dominating his semi-final runs, he failed to finish on the podium.

This time, with Australians Anthony Dean and Sam Willoughby setting a hot pace in the semis and looking favorites for gold, Fields stole their thunder with a perfect ride in the one-off climax to a thrilling couple of days.

"I knew it was all about getting to the finals, then everything is wiped off the board," Fields told reporters.

"It was one shot for glory. Once I got in the final I smiled and said right I'm going to put all my cards on the table and have a crack at it.

"I had the best start probably in my entire life then I found a hole and got in front. When I exited the last corner I realized I knew an Olympic gold medal was 70 meters in front of me. I was like 'Get to the line, get to the line.'"

Fields' place in Rio was in doubt after he broke his wrist in a crash in April - an injury that required surgery.

Afterwards he said the bone was actually still 'broken' and that he had gambled on himself to win a medal.

"It's not healed yet," said the Las Vegas-based speedster who took up BMX at the age of seven.

"I had a great doctor, Randy Viola, who I owe a lot of this to. He was instrumental in putting me back together and giving me a chance to get to the start gate.

"I had to bet on myself because if I had hit the wrist again I risked permanent damage. But if I'm not going to bet on me who will bet on me? So I trusted my ability."

Dutchman Jelle van Gorkom was second with Colombia's Carlos Alberto Ramirez Yepes third after edging out Long in a photo finish.

While Fields won his country's first Olympic BMX gold, compatriot Alise Post was runner-up in the women's event behind Colombian Mariana Pajon.

"It was a long four years after London 2012," said Post, who like Fields suffered heartache in London when tipped for gold. "Very proud of my team mates."

(Reporting by Martyn Herman; Editing by Meredith Mazzilli and Bill Rigby)