image copyrightGetty Imagesimage captionBasketball veteran Kim Gaucher, who played for Canada in Rio, had to fight to bring her infant daughter to the game
At the first Olympic Games of the modern era, Athens 1896, International Olympic Committee (IOC) founder Baron Pierre de Coubertin barred women from competing.
In Paris four years later, 22 female athletes were invited in five ladies sports, while nearly 1,000 men took on the rest of the events.
This year, the Games have nearly reached gender parity.
Of the almost 11,000 Olympic athletes in Tokyo almost 49% are women, according to the IOC, marking the first "gender-balanced" games in its history.
At the Paralympics, at least 40.5% of athletes will be women, the IOC said, with about 100 more female athletes than in Rio de Janiero in 2016.
But 125 years after the first Olympics, the games are still clouded by missteps and hasty corrections relating to gender, underscoring the distance left to go.
Here's a look at some of the challenges faced by female Olympians, before they can even go for the gold. Representatives of the IOC did not respond to a request for comment.
Mandy Bujold, 33, is one of the best female flyweight boxers in the world.
An 11-time Canadian national champion with two Pan-American Games titles, she was ranked eighth in the world in 2018 when she took a break from boxing to give birth to her daughter, Kate Olympia – or KO.
She planned her comeback for Tokyo – a plan that was derailed by the Covid-19 pandemic. Boxing's qualifying events were cancelled and the IOC's boxing task force turned instead to three tournaments in 2018 and 2019, when Ms Bujold was pregnant or postpartum and not competing.
Ms Bujold was forced to fight for her spot outside the ring, taking on boxing's international body in court.
Weeks before the games began, Ms Bujold won with a ruling from the Court of Arbitration for Sport, an international body in Switzerland, that said accommodation must be made for women who are pregnant or postpartum during the qualifying period.
image copyrightGetty Imagesimage captionMandy Bujold successfully appealed after missing the qualifying period while pregnant
"My Olympic dream is still intact," she said. "It was one of the biggest fights of my career, but also the fight with the most meaning."
However, advocates say Ms Bujold's pre-Olympic fight is clear evidence of the gender gap.
"Sport has been built, designed and organised for male participants," said Cheryl Cooky, a professor of gender studies at Purdue University and editor of Sociology of Sport Journal.
When exceptions are made, "it's considered a 'special' accommodation" – another way of saying that women's sports are "less" than men's, she said.
A back-and-forth on breastfeeding
As part of the Games' Covid-19 safeguards, the IOC barred all athletes' family members from traveling to Tokyo.
For Kim Gaucher, a Canadian basketball player, the rule meant a choice between her third Olympic Games and her infant daughter.
"Right now I'm being forced to decide between being a breastfeeding mom and an Olympic athlete, I can't have them both," Ms Gaucher said in a video posted to Instagram in June.
The IOC initially denied Gaucher's formal appeals, saying it was unlikely that any "unaccredited people from overseas" would be allowed to attend.
image copyrightGetty Imagesimage captionCanadian basketball veteran Kim Gaucher had to fight to bring her infant daughter to the game
Tokyo's organisers reversed themselves three weeks ahead of the Games following Gaucher's video plea and mounting public pressure.
"That is not acceptable. Infants are not fans, they're not 'unaccredited persons', they're children with needs," said Nicole M LaVoi, the director of the Tucker Center for Research on Girls and Women in Sport at the University of Minnesota. "You can't claim to value and respect women and give that lip service and then have a misstep like this."
And both Ms LaVoi and Ms Cooky said that incidents like this place an asterisk alongside women's sports, reinforcing the idea that the field is not really meant for them.
The IOC's gender imbalance
While IOC has made gender parity a priority for Olympic athletes, that standard has not been applied the IOC itself.
Women make up 33.3% of its executive board, and 37.5% of committee members overall are female.
"We've never had a woman as the president of the IOC, ever," Ms LaVoi said. "That's telling."
And in recent months, some of the men in charged have undermined the IOC's message of commitment to gender equality.
In February, the president of the Tokyo Olympics Organising Committee was replaced after remarking publicly that women speak too much in meetings. One month later, the creative director of the Games' opening ceremony stepped down after it was revealed he had mocked a plus-size fashion designer for her appearance.
This week, the Australian Olympic Committee president John Coates sparked criticism following a bizarre exchange with the premier of Queensland Annastacia Palaszuck, in which Mr Coates ordered Ms Palaszuck to attend the opening ceremony.
media captionJohn Coates: Australian Olympic boss in awkward 'mansplaining' row
Advocates say that as long as the IOC remains male-dominated – "a good old boys club", said Ms LaVoi – female athletes will be left at a disadvantage.
In the meantime, gender progress at the Olympics will be spotty – marred by the types of challenges faced by Mandy Bujold and Kim Gaucher.
"Would these even be controversies if the people in the room weren't majority men?" Ms Cooky said. "I don't think so."