The first notes of Ed Sheeran’s Shape Of You had just played when Gabriella Papadakis suddenly became aware that people were about to see a whole lot more of her shape than she had planned.

The French ice dancer’s glittering emerald costume at the Olympics had come unhooked at the neckline and later in the routine her left breast was exposed live on television.

When the clasp became unhooked, 22-year-old Papadakis was more worried about holding up her outfit than making sure her twizzles and rhumba were in sync.

Pyeongchang Olympics Figure Skating Ice Dance
Gabriella Papadakis and Guillaume Cizeron perform their short programme (Julie Jacobson/AP)

Her swinging short programme with partner Guillaume Cizeron at the Pyeongchang Olympics was threatening to go down in history alongside Janet Jackson’s infamous wardrobe malfunction during her halftime performance at the Super Bowl.

“I felt it right away and I prayed,” Papadakis said. “That’s about what I could do.”

Somehow, the French couple kept things together for most of their Latin programme, producing a score of 81.93 points which left them second behind Canadian stars Tessa Virtue and Scott Moir.

But it was during the final element, when Papadakis leaned back in Cizeron’s arms, that her costume rode up to reveal her breast.

Pyeongchang Olympics Figure Skating Ice Dance
Gabriella Papadakis’s outfit rode up as she leaned back in Guillaume Cizeron’s arms (AP Photo/Julie Jacobson)

The performance was being shown live on international television, and people immediately began posting screen-grabs of the incident on social media.

“Our coverage of ice dancing was live tonight. Once a competitor’s brief wardrobe issue became evident, we purposely used wider camera shots and carefully selected replays to keep the issue obscured,” NBC said in a statement to The Associated Press. “We have edited the video for all television encores and online replays.”

It was the second wardrobe mishap during the skating programme at the Pyeongchang Games.

American-born ice dancer Yura Min, competing for South Korea, had the back of her costume come unclasped during her short programme with partner Alex Gamelin in the team competition.

Papadakis and Cizeron, considered the biggest threat to Virtue and Moir for gold, still managed to gain level-four marks for all their elements except their final straight line lift. That left the French duo less than two points behind their Canadian training partners on a packed leaderboard.

Pyeongchang Olympics Figure Skating Ice Dance
The pair react as their points are posted following their performance (Julie Jacobson/AP)

It was unclear whether the judges docked the couple marks for the wardrobe issue. The rules state that losing any part of a costume, even a hair clip, can lead to a one-point deduction.

“It’s a little bit frustrating to know that it’s not because of something that we did,” Cizeron said. “It’s just a costume issue, something as stupid as that, so it’s a little bit disappointing.”

Papadakis was nearly in tears as she approached reporters after the routine, which is required of any Olympic competitor after taking part.

But she was in better spirits an hour later, when she no doubt realised that her chance of a gold medal was still intact.

“It was pretty distracting, kind of my worst nightmare happening at the Olympics,” she said.

“I told myself, ‘I don’t have a choice. I have to keep going’, and that’s what we did. I think we can be proud of ourselves being able to deliver a great performance with that happening.”