The district was sued in 2009 after a fifth-grade boy who identifies as a girl was denied access to the girls' bathroom at the elementary school.

BANGOR, Maine (AP) _ A Maine judge has ruled in favor of the Orono school district and against the parents of a transgender child who was barred from using the girls' bathroom at school.

The district was sued in 2009 after a fifth-grade boy who identifies as a girl was denied access to the girls' bathroom at the elementary school. The family also claimed the school failed to stop other students from harassing the transgender student.

The Bangor Daily News says Justice William Anderson ruled Tuesday that the school acted within its authority in barring the child from the girls' restroom, didn't harass the child and wasn't deliberately indifferent to the harassment subjected by others.

The Gay & Lesbian Advocates & Defenders, which is representing the student, said it will appeal.