Swimming's world governing body FINA on Sunday voted to restrict the participation of transgender athletes in elite women's competitions and create a working group to establish an "open" category for them in some events as part of its new policy.
"I do not want any athlete to be told they cannot compete at the highest level," Husain Al-Musallam, president of governing body FINA, told an extraordinary congress of his organisation.
"I will set up a working group to set up an open category at our meets. We will be the first federation to do that."
The decision was made during FINA's extraordinary general congress on the sidelines of the world championships in Budapest after members heard a report from a transgender task force comprising leading medical, legal and sports figures.
The new policy will require transgender competitors to have completed their transition by the age of 12 in order to be able to compete in women's competitions.
Brent Nowicki, FINA's CEO, said the organisation was determined to maintain separate men's and women's competition.
He added that FINA "recognises that certain individuals may not be able to compete in the category that best aligns with their legal gender alignment or gender identity."
Under the rules, he said, male competition would be open to all.
But "male-to-female transgender athletes and intersex athletes can only compete as female athletes in FINA competition, or set a world record, if they can prove they have not experienced any element of male puberty."
In the debate that followed, Dr Christer Magnusson, a Swedish member of FINA's medical committee, was among those who complained that the implication was that boys aged as young as 10 would have to decide to start transitioning.
The policy was passed with a roughly 71% majority after it was put to the members of 152 national federations with voting rights who had gathered for the congress at the Puskas Arena.
Last year, the International Olympic Committee announced guidelines but asked federations to produce their own 'sport-specific' rule.
FINA set up three expert committees, one medical, one legal and one of athletes, to look at the issue.
The medical committee found that men who transitioned to woman retained advantages.
"Some of the advantages males acquire in puberty are structural and are not lost with hormone suppression," said Dr Sandra Hunter of the Marquette University in Milwaukee.
"These include larger lungs and hearts, longer bones, bigger feet and hands."
The legal experts concluded that the policy of excluding most transgender swimmers would be legal.
They were "necessary and proportionate to achieve a legitimate objective," said London-based barrister James Drake.
For the swimmers, Cate Campbell, an Australian four-time Olympic gold medallist said: "My role is to stand here today and tell trans people we want you to be part of the broader swimming community ... but also to stand here and say... 'listen to the science'."
In the United States, swimming has moved to the centre of the debate over transgender women competing against natal women, as Lia Thomas has become the face of the issue.
Thomas, a freestyle specialist, competed for the University of Pennsylvania, men's team from 2017-19.
After transitioning and undergoing required hormone therapy, she raced on the women's team this season.
Thomas became the first known transgender athlete to win an elite US collegiate title when she edged Olympic medley silver medallist Emma Weyant in the 500m freestyle in Atlanta in March.