CNN — 

A federal appeals court on Wednesday sided with a Catholic high school that fired a gay teacher over his plans to marry his partner, saying that the termination did not violate federal workplace protections for LGBTQ workers.

A three-judge panel of the Fourth Circuit Court of Appeals said the North Carolina school did not violate Lonnie Billard’s rights under Title VII of the Civil Rights Act of 1964, a federal anti-workplace discrimination law that protects against race, sex and religious discrimination.

Two members of the panel held that Billard “played a vital role as a messenger” of Charlotte Catholic High School’s faith values and said as a result, his firing was permissible under the “ministerial exception to Title VII.”

“We conclude that the school entrusted Billard with ‘vital religious duties,’ making him a ‘messenger’ of its faith and placing him within the ministerial exception,” Circuit Judge Pamela Harris wrote in the majority decision.

The third judge agreed with the judgement, but said in a partial dissent that he would have resolved the case on different grounds.

According to the Equal Employment Opportunity Commission, the First Amendment safeguards the rights of religious organizations “free from interference from civil authorities, to select those who will ‘personify its beliefs.’” This is known as the “ministerial exception.”

The ruling from the appeals court is a notable departure from previous rulings by the court that have helped advance LGBTQ rights in various areas of life, including a pair of rulings last month that said state health insurance plans in North Carolina and West Virginia unlawfully excluded coverage for gender-affirming care, and a ruling in favor of a young trans athlete in West Virginia who was barred from participating in school sports under a state law.

Lonnie Billard, right, and his husband Richard Donham.

Billard told CNN he is “very disappointed” in the court’s decision and worries he is running out of options.

“There’s lots and lots of case law that backs me up. But my biggest feeling is confusion,” he said. “I just felt you can’t tell people who you can love and who you can marry. That’s not right, you can’t, you shouldn’t be able to fire somebody because they love someone else. And that’s why I went through what I did.”

Billard said in October 2014, while he still worked for Charlotte Catholic High School, he announced his engagement to his partner on social media. Although he’d worked for the school for a decade, Billard said he was fired from his job two months later.

He said he filed a discrimination complaint with the EEOC and then an employment discrimination lawsuit in 2017 against Charlotte Catholic High School, Mecklenburg Area Catholic Schools and the Roman Catholic Diocese of Charlotte.

Billard married his partner in May 2015 and says he loved every minute of his teaching career even though it ended abruptly. He is now retired.

CNN reached out to Mecklenburg Area Catholic Schools and Charlotte Catholic High School for comment on Thursday.

Luke Goodrich, vice president and senior counsel at Becket who represents the Roman Catholic Diocese of Charlotte, called the decision a “victory for people of all faiths who cherish the freedom to pass on their faith to the next generation.”

“The Supreme Court has been crystal clear on this issue: Catholic schools have the freedom to choose teachers who fully support Catholic teaching,” Goodrich said a in a statement.