A federal court has ruled that Catholic schools cannot fire teachers for being gay after one in North Carolina did just that.

In 2014, the Charlotte Catholic High School and the Roman Catholic Archdiocese of Charlotte gave Lonnie Billard the sack after he announced that he was marrying a man on Facebook.

According to Billard’s 2017 lawsuit against the school, local diocese spokesman David Hains publicly said that he was dismissed for “going on Facebook, entering into a same-sex relationship, and saying it in a very public way that he does not agree with the teachings of the Catholic Church”.

Billard had been a longtime staff member at the school at the time of his firing, having taught there for more than 10 years and been winning the Teacher of the Year award in 2012.

The lawsuit explained that he eventually became a regular substitute teacher and usually worked more than a dozen weeks per academic year.

“Apparently there were a couple teachers there who are super-conservative Catholic,” Billard said when he was let go from his job. “They are not friends of mine on Facebook, but they found out about it and escalated it so it got to the diocese.”

Now, U.S. District Judge Max Cogburn ruled that the firing of substitute drama and English teacher Lonnie Billard in 2014 was a wrongful dismissal.

The 3 September ruling said that the school violated Title VII of the Civil Rights Act, which offers federal protection against sex discrimination.

Judge Cogburn said that the school’s actions were not protected by constitutional rights to religious freedom, adding that it “didn’t fit into exemptions to labor law that give religious institutions leeway to require certain employees to adhere to religious teachings”.

The judge added: “Plaintiff is a lay employee, who comes onto the campus of a religious school for the limited purpose of teaching secular classes, with no mandate to inculcate students with Catholic teachings.”

Billard requested back pay, benefits, punitive damages, compensatory damages for emotional distress and a court order blocking the school and diocese from sacking other LGBTQ+ staff members in the future – though the judge ruled that this will have to be figured out in a later trial.

“The First Amendment, federal law, and recent Supreme Court decisions all recognize the rights of religious organizations to make employment decisions based on religious observance and preference,” the diocese wrote in a statement to The Charlotte Observer. “They do not — and should not — compel religious schools to employ teachers who publicly contradict their teachings.”

The school and diocese are reportedly deciding whether or not to appeal the ruling.