PHILADELPHIA — A gay teacher at a suburban Philadelphia Catholic high school was fired Friday after he applied for a New Jersey marriage license.

Michael Griffin was fired from Holy Ghost Preparatory School after administrators said his obtaining a license to marry his same-sex partner was a violation of his contract.

Father James McCloskey, the school’s headmaster, said in a statement that faculty at the school are required to follow church teachings, NBC Philadelphia reported.

He said in the statement that Griffin’s decision “contradicts the terms of his teaching contract at our school, which requires all faculty and staff to follow the teachings of the Church as a condition of their employment. In discussion with Mr. Griffin, he acknowledged that he was aware of this provision, yet he said that he intended to go ahead with the ceremony.”

Griffin, who graduated from the school and has taught French and Spanish there for 12 years, said that his relationship with his partner of 12 years wasn’t a secret from the school and that his partner had even been to McCloskey’s house.

Griffin lives in New Jersey, which became the 14th state to recognize same-sex marriage in October.