Updated

A Philippine court on Thursday ordered a Catholic girls' school to allow five students to attend graduation ceremonies after they were barred over photos on Facebook that showed them wearing bikinis.

Judge Wilfredo Navarro of central Cebu City issued a restraining order against St. Theresa's College High School, calling its decision to ban the students from Friday afternoon's ceremonies un-Christian and unlawful.

School officials took action against the girls for what they called "engaging in immoral, indecent, obscene or lewd acts," according to court records. They allowed the students to graduate but not participate in activities or ceremonies.

The judge ordered the school to allow the girls to join the graduates' procession. The school declined to comment, but asked the court to reconsider on Friday morning.

The girls' lawyer, Cornelio Mercado, said a photo showed one girl holding a cigarette and a liquor bottle, while others showed all five girls wearing bikinis at a beach party early this year.

Earlier this month, the five girls were summoned by the principal and other school officials, "dressed down" and called "sluts" for their Facebook pictures, Mercado said.

Mercado alleged that the school officials had illegally obtained the pictures since they were not Facebook "friends" of the girls and were not allowed access.

The mother of one girl petitioned the court on behalf of her daughter. Mercado said the ruling applied to all five.

Judge Navarro castigated the school officials for calling the girls "inappropriate names," including "disgusting," "cheap" and "drunkards," and said the students had gone through "a psychologically and emotionally devastating experience." He said not allowing them to participate in graduation activities "would indeed be most un-Christian if not entirely inhuman."

Mercado, the lawyer, said the families will file charges of child abuse and "grave oral defamation" against the school and school officials.