The bill passed by the state's legislature on 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.
"Over a dozen states have considered anti-LGBT bills this legislative session -- but none has moved as far as South Dakota's," the National Center for Transgendered Equality said in a statement.
"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."
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."
The bill aims to evade federal law prohibiting discrimination in schools by offering "reasonable accommodation" to transgendered students such as allowing them to use bathrooms and locker rooms designated for single-occupancy or faculty use.
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."
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.