Critics argue that boys and girls socialise out of school too
Bauchi State in northern Nigeria has banned co-education at all junior and senior schools.
The bill, passed by the state MPs this week, listed a number of reasons including the need to fight teenage pregnancies and poor performance.
Bauchi MP Aminu Tukur told the BBC that teenagers especially had difficulty controlling their sexual urges.
The BBC's Shehu Saulewa in Bauchi, which is governed by Sharia law, says most state schools are mixed.
He says schools are due to go back next week after the summer holidays.
It is not yet clear when they will have to become single-sex institutions.
Religious leaders within the state's minority Christian population are opposed to the ban, our reporter says.
They argue that schools are not the only places where girls and boys socialise.
Private religious schools will not be subject to the ruling.
Several of Nigeria's Muslim majority northern states introduced Sharia law starting in 2000, despite opposition from Christians, sparking clashes and riots between rival groups.