Schools that allow children to use the bathroom of their opposite sex will lose some state funding, under Oklahoma's third bill directed at transgender people this year.
The new legislation dubbed the "bathroom bill" will oblige all school children to use the bathroom that aligns with their biological sex assigned at birth.
Under the law, parents or students can report minors suspected of violating the rule to school officials, who are required to investigate and potentially discipline the students.
Schools that violate or do not enforce the order could lose up to 5 per cent of their state funding.
Trans pupils who do not comply will be required to use a "single-occupancy restroom or changing room" on-site.
The bill is expected to be signed by Governor Kevin Stitt this week and become the third law this year that targets trans people in Oklahoma.
The new school bathroom law passed the state's Senate 38-to-7 and 69-to-15 in the House.
Republican state representative Danny Williams, who authored the bill, said the goal was to "protect our children", according to local news outlet KTUL.
"It's about safety, it's about protection, it's about common sense," Williams said.
A number of so-called "bathroom ban" bills have been passed in other states, including Texas and North Carolina.
In an impassioned argument against the law, Democrat representative Jacob Rosencrants, whose son is trans, said it would isolate trans students.
"My child wants to go to the bathroom where he feels comfortable," Rosencrants said. "My kid just wants to 'be' … and he doesn't feel like he can do that in this state."
The Republican state became the first in the country to explicitly ban nonbinary gender markers on birth certificates for people who do not identify as male or female.
Transgender females have also been banned from competing in women's sports teams. Similar bans have been enacted in 15 other states, including Florida, Arizona and Alabama.
"When it comes to sports and athletics: Girls should compete against girls. Boys should compete against boys," Stitt said.
Oklahoma also passed the most restrictive abortion law in America last week, with legislation that prohibits abortion from the moment of fertilisation and relies on lawsuits from private citizens to enforce it.
Exceptions are made only if the woman has been a victim of rape or incest and has referred the incident to the police.
Abortion providers and anyone who "aids or abets" an abortion can be subject to civil suits from private individuals.
Stitt has vowed to make Oklahoma the most anti-abortion state in America. No other state has banned abortions from such an early stage.
The move has been made ahead of the expected overturning of Roe v Wade which gave women the constitutional right to have an abortion.
Oklahoma has been under the spotlight in recent months for its increasingly restrictive laws.
Another bill, signed by MMStitt in April and set to take effect in August, will make it a felony to perform an abortion, punishable by up to 10 years in prison and a fine of up to US$100,000. It is being challenged in state district court.