Cyclist Jason Kenny won his sixth Olympic gold medal in the men's keirin on Tuesday night. Kenny, 28, is now tied with Sir Chris Hoy for a British record.
But the historic moment almost never happened because Kenny nearly got disqualified before the start of the race.
Both Kenny, as well as Malaysian rider Azizulhasni Awang, overlapped with the derny before it left the track, which is against the rules.
The derny is a motorised bike that leads up to eight riders on the track. It creates a slipstream that makes it easier for riders to cycle, according to The Guardian. The derny starts the eight-lap race going at around 16 miles per hour and gradually accelerates until it reaches 31 mph. It then pulls off the track with two-and-half laps left in the race. Riders must stay behind the back wheel of the derny before it leaves the track. Then, it is a sprint to the finish.
Here is how the six riders look lined up behind the derny in the men's keirin final:
In Tuesday night's final, both Kenny and Awang appeared to overlap with the derny "right as it was peeling off the track," according to a BBC commentator.
Here is the moment that Kenny and Awang seemed to pull ahead a moment too soon:
The race was stopped for several minutes as judges replayed the footage. It seemed like Kenny's chance at a sixth gold medal had been crushed.
Kenny's fiance, four-time Olympic gold medal winner Laura Trott, looked on nervously.
The judges ultimately allowed both riders back in the race since the call was "borderline," according to the BBC.
However, commentators were dumbfounded when the race was stopped for a second time after Germany's Joachim Eilers appeared to overlap the derny again.
"I have never seen anything like this," BBC commentator and two-time Olympic keirin champion Chris Hoy said in disbelief. "You see this once in a blue moon, where a rider will pass the back of the bike."
Given how rare it is for a keirin race to be halted, it isn't clear why it happened twice in one race, although the BBC's commentators speculated that it may have been down to the derny rider peeling off the track later than usual, making it confusing for the riders.
After reviewing the footage again, all riders were allowed back in the race and it was restarted for the third time. This time, Kenny was victorious.
The keirin has a fascinating history as a cycling event. It was invented in the Japanese city of Kokura in 1948 as a gambling sport, and was used to help rebuild cities devastated by war using event profits and as a means of financing the reconstruction of the city, according to cycling blog Shut Up Legs.
The sport is massively popular in Japan, and people wanting to be professional racers in the country must undertake a gruelling training regime involving 15-hour long days and 6:30 a.m. starts.
Japan's Koichi Nakano, widely regarded as one of the greatest keirin riders, won 10 consecutive world championships in the 70s and 80s. However, despite its popularity in the country, Japanese athletes have not been particularly successful in the keirin globally in recent years.