Elinor Barker struck gold in the women’s scratch race at the UCI Track Cycling World Championships in Poland.

The 24-year-old from Cardiff launched her attack with two laps of the 40 remaining and, after a crash wiped out several riders behind, held off Holland’s Kirsten Wild to take the rainbow jersey in Pruszkow. It is a fourth world title for Barker but first in this event. “That was always my plan,” Barker said of the late surge. “I wanted to stay out of the carnage. It’s always a bit sketchy.

“It’s the first race of the week and everyone’s fresh, everyone wants a sprint but no one wants to take it on. I wanted to stay out of the way a little bit – for safety but also to save the legs because I’ve got the team pursuit tomorrow and this was always the secondary event.”

Barker revealed she almost quit cycling in 2018 but rediscovered her love of the sport and recorded a superb victory.

“It’s a massive surprise,” she said. “It feels really bizarre. I came really close to quitting completely about six months ago. I’d kind of fallen out of love with it so just to get here felt like such an achievement itself.

“I fell out of love with it for a number of factors, but I’ve got it back now. I owe a huge amount to our new psychologist who we got around October time. He managed to keep me going and feeling at my best again.”

The 36-year-old Wild, a two-times scratch race world champion, had to settle for silver with Jolien D’Hoore of Belgium third. The crash created a slightly muted finish to the race, with it taking a few moments for Barker’s victory to be confirmed.

“I didn’t know about the crash until I’d finished,” Barker said. “I heard the noise; I thought one or two people had crashed and that’s fairly typical for a scratch race to be honest. I didn’t know how big it was. “I hope everyone’s OK. I wasn’t sure whether to celebrate or not. I didn’t want to lose my moment but I didn’t want to be disrespectful so I kind of waited a little bit.”

Earlier in the day Barker joined Katie Archibald, Laura Kenny and Ellie Dickinson to set the second fastest time in qualifying for the team pursuit, stopping the clock at 4min 15.618sec, leaving them 0.7sec behind Australia’s pace.