Simone Biles trained in secret behind locked doors at a university gymnasium to overcome her bout of the "twisties" that threatened to end her Olympic run in Tokyo before she battled back to win a bronze on the balance beam, according to a Wall Street Journal report.

On Wednesday, Biles took to Twitter to thank those at Juntendo University who made her training possible.

"I'll forever be thankful for Juntendo for allowing me to come train separately to try to get my skills back," she wrote on Twitter.

"The Japanese are some of, if not the sweetest people I've ever met."

According to the Journal, Biles trained at the gym several hours a day for four days starting last Wednesday, each day accompanied by medical staff and trainers. While there, Biles was able to regain her confidence in privacy on the gym's soft mats and foam pits, the paper reported.

The 24-year-old American had come to Japan eyeing a record haul of six golds, but shocked the sports world when she pulled out of the opening event, the team competition, after just one vault.

She said she needed to prioritize her mental health and it appeared as if she would not return, but she staged a comeback to take the bronze in the final event on Tuesday.

The team silver and the beam bronze took Biles' career Olympic haul to seven medals.

Juntendo University professor Kazuhiro Aoki, who arranged for the school to shelter Biles during training, told the Journal that Biles clearly was out of sorts. “She looked like a totally different person,” Aoki told the Journal. “Her movements were not smooth, and she often got frozen.” 

Biles has been praised for her candor and for bringing attention to mental health issues during the Games. The International Olympic Committee (IOC) has acknowledged that more needs to be done for athlete well-being.

"Mentally I still have a lot of things that I have to work on but to bring the topic of conversation on mental health to light means the world to me," Biles said. "People have to realize that at the end of the day we're humans, we're not just entertainment."

Information from Reuters was used in this report.