A gay teacher at a US Catholic high school has been fired after he applied for a marriage licence.

Michael Griffin was fired from Holy Ghost preparatory school in Bensalem, Pennsylvania, after administrators said obtaining a licence to marry his same-sex partner was a violation of his contract.

The school's headmaster, Father James McCloskey, said in a statement that faculty at the school were 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 his relationship with his partner of 12 years was not 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 recognise same-sex marriage in October.