United Methodist church officials defrocked a pastor from central Pennsylvania on Thursday who violated religious doctrine by officiating his son's gay wedding, and he later said he was shocked by their decision, calling his involvement in the wedding an "act of love."

Frank Schaefer immediately appealed the penalty, which he believed was meted out reluctantly by many members of the regional Board of Ordained Ministry.

"So many of them came to me and they shook my hand and some hugged me, and so many of them had tears in their eyes," Schaefer said. "They said, 'We really don't want to do this, you know that, don't you?'"

John Coleman, a spokesman for the Eastern Pennsylvania Conference of the denomination, said Schaefer left the board no choice after defying the order of a religious jury by refusing to resign.

"When asked to surrender his credentials as required by the verdict, he refused to do so," Coleman said. "Therefore, because of his decision, the board was compelled by the jury's decision to deem his credentials surrendered."

Schaefer has led a congregation in the central Pennsylvania town of Lebanon more than a decade. Earlier this year, a church member filed a complaint over Schaefer performing the 2007 wedding of his gay son in Massachusetts, where same-sex unions are legal.

Although the Methodist church accepts gay and lesbian members, it rejects the practice of homosexuality as "incompatible with Christian teaching."

Last month, a church jury suspended Schaefer for 30 days and said he should use the time to decide whether he could uphold the church's Book of Discipline. If he decided he could not, he was told to resign from the clergy by Thursday.

Schaefer said he told officials Thursday morning that he could not uphold a book that he feels is contradictory and biased against gay people. He refused to voluntarily surrender his credentials when asked by the board president.

"To which she said, 'Well, we're taking them.' And that was the end of it." Schaefer said.

Later, he said, "I said to myself, 'You know, I just can't see them taking my credentials.' I mean what I did was an act of love for my son. And they did anyhow."

Although the Methodist church accepts gay and lesbian members, it rejects the practice of homosexuality as "incompatible with Christian teaching" and bars clergy from performing same-sex unions.

The issue has split the nation's largest mainline Protestant denomination amid a rapid shift in public opinion. Same-sex marriage will soon be legal in 16 states, and opinion polls show that a majority of Americans now support it. Hundreds of Methodist ministers have publicly rejected church doctrine on homosexuality, and some of them face discipline for presiding over same-sex unions. Last month, in a public challenge to church rules, a retired Methodist bishop officiated at a wedding for two men in Alabama.

Most other Protestant denominations have decided their position on the issue one way or another. But the Methodists, with about 7.7 million members in the U.S. and many more members overseas, remain divided. At their last national meeting in 2012, delegates reaffirmed the church's 40-year-old policy on gays.