Fina, swimming's world governing body, has voted to stop transgender athletes from competing in women's elite races if they have gone through any part of the process of male puberty.
Fina will also aim to establish an 'open' category at competitions for swimmers whose gender identity is different than their birth sex.
The new policy, which was passed with 71% of the vote from 152 Fina members, was described as "only a first step towards full inclusion" for transgender athletes.
The 34-page policy document says that male-to-female transgender athletes could compete in the women's category - but only "provided they have not experienced any part of male puberty beyond Tanner Stage 2 [which marks the start of physical development], or before age 12, whichever is later".
The decision was made during an extraordinary general congress at the ongoing World Championships in Budapest.
It means that transgender American college swimmer Lia Thomas, who has expressed a desire to compete for a place at the Olympics, would be blocked from participating in the female category.
Earlier Fina members heard a report from a transgender task force made up of leading figures from the world of medicine, law and sport.
"Fina's approach in drafting this policy was comprehensive, science-based and inclusive, and, importantly, Fina's approach emphasised competitive fairness," said Brent Nowicki, the governing body's executive director.
Fina president Husain Al-Musallam said the organisation was trying to "protect the rights of our athletes to compete" but also "protect competitive fairness".
He said: "Fina will always welcome every athlete. The creation of an open category will mean that everybody has the opportunity to compete at an elite level. This has not been done before, so Fina will need to lead the way. I want all athletes to feel included in being able to develop ideas during this process."
Former Great Britain swimmer Sharron Davies, who has argued against transgender participation in women's elite swimming, told BBC Sport she was "really proud of Fina".
"Four years ago, along with 60 other Olympic medallists, I wrote to the IOC and said 'Please just do the science first' and no governing body has done the science until now," she said.
"That is what Fina has done. They've done the science, they've got the right people on board, they've spoken to the athletes, and coaches.
"Swimming is a very inclusive sport, we love everyone to come and swim and be involved. But the cornerstone of sport is that it has to be fair and it has to be fair for both sexes.
Asked whether Fina's policy left trans athletes "in limbo" while they waited for an open category to be created, Davies praised Fina for having conversations around trans inclusion that should have "happened five years ago".
"Sport by definition is exclusionary - we don't have 15-year-old boys racing in the under-12s, we don't have heavyweight boxers in with the bantamweights, the whole reason we have lots of different classes in the Paralympics is so that we can create fair opportunities for everybody," she said.
"So that is the whole point of having classifications in sports and the only people who were going to be losing out were females - they were losing their right to fair sport."
However, 'Athlete Ally' - an LGBT advocacy group which organised a letter of support for Thomas in February, called the new policy "discriminatory, harmful, unscientific and not in line with the 2021 IOC principles".
"The eligibility criteria for the women's category as it is laid out in the policy polices the bodies of all women, and will not be enforceable without seriously violating the privacy and human rights of any athlete looking to compete in the women's category," said Anne Lieberman, the group's director of policy and programmes.
BDST: 1242 HRS, JUN 20, 2022
SMS