A federal judge has ruled that a Catholic high school in North Carolina wrongly fired a gay teacher after he announced plans to marry his long-time partner.

U.S. District Judge Max Cogburn said in his ruling that the firing of Lonnie Billard in 2014 violated federal sex discrimination laws.

Billard taught English and Drama at Charlotte Catholic High School for 13 years. He was named the school's Teacher of the Year in 2012.

Billard announced in an October 2014 Facebook post that he was marrying his long-time partner, who was known in the community.

Billard was told that he was terminated because his announcement was tantamount to advocating for marriage equality, which the Catholic Church is opposed to.

“I know that the Catholic Church opposes same-sex marriage, but I don’t think my commitment to my husband has any bearing on my work in the classroom,” Billard said. “I have never hidden the fact that I’m gay and my relationship with my partner was no secret at school. But whether or not the school previously knew that I am gay is not the point. People should be able to fall in love and get married without risking their jobs.”

Cogburn noted in his ruling that heterosexual employees announcing their marriages on Facebook would not face a similar fate as Billard.

He ruled that the defendants had violated Title VII and that the case would “proceed to trial to determine the appropriate relief that should be granted.”

Billard is represented by the ACLU, ACLU of North Carolina, and Tin Fulton Walker & Owen law firm.