The bill passed by the state's legislature Tuesday comes amid backlash against a stream of legislative and legal victories for gay, lesbian, bisexual and transgendered rights.
South Dakota Governor Dennis Daugaard has not yet said whether he will sign or veto the bill.
In a landmark June ruling, the US Supreme Court overturned same-sex marriage bans, and 17 states have enacted laws to protect students from bullying or harassment based upon their sexual orientation or gender identity.
"If the governor signs this bill into law, South Dakota will be the first state with a law prohibiting trans students from using the right restrooms."
Also Read
The bill restricts access to bathrooms and locker rooms in all public schools to students of the "same biological sex." The restrictions extend beyond the schools to include any off-campus events like a sports tournament which may involve "being in a state of undress in the presence of other students."
It also stipulates that the state will be responsible for covering legal expenses if school districts are sued for complying with the law.
The Human Rights Campaign called the legislation "extreme and dangerous" and said it would only "exacerbate the discrimination and harassment that transgender students already face.