Florida has become the latest US state to ban transgender girls and women from participating in female sports at public schools and colleges.
The state's Republican governor Ron DeSantis signed the measure into law on Tuesday.
The law says women and girls must play on the teams of the biological sex on their birth certificate.
LGBT activists have denounced the move as "discriminatory", with one group vowing to launch a legal challenge.
"We believe that is very important that the integrity of these competitions are preserved," Mr DeSantis said as he signed the law at a Christian school in Jacksonville city.
"We're gonna go based on biology, not based on ideology when we're doing sports."
The move comes as Republican-led states push back against pro-LGBT policies supported by the administration of Democratic US President Joe Biden.
What does the law say?
Florida's law defines an athlete's sex as that stated on official documents at birth.
Called the Fairness in Women's Sports Act, the law says sports teams for girls and women "may not be open to students of the male sex".
It's not clear whether all female athletes must now show their birth certificates to be in sports teams.
The law would not bar female athletes from playing on boys or men's teams.
The law also allows students to take legal action against the school if they feel it has violated the act and "deprived" them "of an athletic opportunity".
Supporters of the bill say transgender female athletes have an unfair advantage, having been designated male at birth but having since transitioned.
But critics say the banning of transgender girls and women from sports is unnecessary and discriminatory.
The law will apply to public secondary and high schools, colleges and universities when it comes into effect on 1 July.
What reaction has there been?
Florida state representative Carlos Smith, a Democrat who identifies as Latino and gay, spoke out against the bill, calling it "appalling".
"This fuels transphobia and puts vulnerable kids at risk for no good reason," he wrote on Twitter.
Another Democratic lawmaker, Shevrin Jonesit, criticised what he called the "insulting" timing of the bill's signing on 1 June, the first day of Pride Month, an annual celebration of the LGBT community.
But Kelli Stargel, a Republican state senator who supported the bill, denied the law was discriminatory.
"This bill is very simply about making sure that women can safely compete, have opportunities and are physically be able to excel in a sport that they trained for, prepared for and work for," Ms Stargel said.
The Human Rights Campaign (HRC), a group which defends LGBT rights, said it would challenge the measure in court.
"Gov DeSantis and Florida lawmakers are legislating based on a false, discriminatory premise that puts the safety and well-being of transgender children on the line," the president of the group, Alphonso David, said.
"Transgender kids are kids; transgender girls are girls. Like all children, they deserve the opportunity to play sports with their friends and be a part of a team."
The Florida move comes as pro-equality measures have gained momentum at the national level.
On his first day in office, President Biden signed an executive order aimed at preventing discrimination on the basis of sexual orientation or gender identity.
In an attempt to make Mr Biden's executive action more permanent, the US House of Representatives passed the Equality Act - considered the most pro-LGBT bill in US history.
On Tuesday, Mr Biden urged lawmakers in Congress to pass the Equality Act as he issued a proclamation to mark the start of Pride Month.
But without Republican support, the bill is unlikely to be passed by the Senate, the upper chamber.