— A gay teacher at a Catholic high school in Southern California lost his job after his wedding pictures were published in a local newspaper, according to the teacher’s lawyer.

Ken Bencomo, 45, was fired from St. Lucy’s Priory after marrying his partner of 10 years, the San Bernardino Sun reported.

Officials were aware of Bencomo’s sexual orientation for at least 10 of the 17 years he worked at the school, according to his lawyer Patrick McGarrigle.

“The reason given was that the marriage occurred and the school’s position was that it violated church teachings,” McGarrigle said.

The firing came days after photos of the wedding appeared in a local newspaper. Bencomo and Christopher Persky, 32, were among the first gay couples to line up at the San Bernardino County Assessor-Recorder’s Office to get married following a U.S. Supreme Court decision that cleared the way for same-sex marriages to resume in the nation’s most populous state.

In a statement, St. Lucy’s said the school educates students in the tradition of the Catholic faith.

“As a Benedictine school, St. Lucy’s is a community for those who wish to express Christian values in education and develop person and academic excellence,” the statement said.

Students have known of Bencomo’s sexual orientation for years, including former St. Lucy’s student Brittany Littleton, who told the Sun that policies regarding staff at Catholic schools need to change.

“I am joined by many students and alumni in saying that we believe this is a fight for love and equality, and as such we wish to display love and kindness, even while feeling hurt and shock,” she said.