BOSTON – The Massachusetts Department of Education on Friday issued directives for handling transgender students, including allowing them to use the bathrooms or play on the sports teams that correspond to the gender with which they identify.

The guidance was issued at the request of state board of education to help schools follow the state’s 2011 anti-discrimination law protecting transgender people.

“These students, because of widespread misunderstanding and lack of knowledge about their lives, are at a higher risk for peer ostracism, victimization, and bullying,” the document read.

Gunner Scott of Massachusetts Transgender Political Coalition welcomed the guidance, saying it would be “immensely helpful to those parents who have been struggling with making sure that the school environment is safe and welcoming of their child.”

But the Massachusetts Family Institute said allowing transgender boys to use girls’ bathrooms, and vice versa, endangers other student and violates their privacy.

“Fundamentally, boys need to be using boys’ rooms and girls need to be using the girls’ rooms, and we base that on their anatomical sex, not some sort of internalized gender identity,” said Andrew Beckwith, counsel for the institute.

The education department said it prepared the 11-page document after consulting policies in several states, as well as advocacy groups, parents and students.

The document said whether a student identifies as a boy or girl is up to the student or, in the case of younger students, the parents. In all cases, “the student may access the restroom, locker room, and changing facility that corresponds to the student’s gender identity,” it said.