A pastor in the US state of Pennsylvania has been sacked by his congregation after conducting a same-sex wedding.

Reverend Ken Kline Smeltzer, 62, of Boalsburg, said to the Associated Press that he officiated at the wedding on 19 August at the home of State College Mayor Elizabeth Goreham.

The mayor pledged in an interview last month that she would have no issue with conducting same-sex weddings. The couple was issued the marriage licence by Montgomery County Clerk D Bruce Hanes, who has since been ordered to cease giving the licences to same-sex couples.

Hanes had said he wanted to come down “on the right side of history and the law” when he began issuing the licenses in late July.

Goreham decided not to preside at marriages herself, as she was told by borough officials that she would be in violation of her oath of office to uphold the state constitution, so instead she invited Smeltzer to preside.

“I knew he was an ordained minister. I don’t know if we’d ever spoken about it. He loves to perform weddings and he thought about it and said ‘yes,’” Goreham said.

Smeltzer has not publicly given the name of the church of which the congregation has asked him to leave, however the Lewistown Sentinel on 13 May showed Burnham Church of the Brethren, as his church.

The Associated Press also reports that it has confirmed Smeltzer as the pastor at the church. Brethren churches employ and dismiss their own pastors, they are not appointed, or assigned by the denomination.

The county clerk Hanes, who had issued hundreds of marriage licences to same-sex couples, has since said he will appeal against the decision to block him from issuing marriage licences.