FILE - In this June 20, 2014, file photo, Frank Schaefer, a United Methodist Church pastor who was defrocked for officiating his son Tim’s wedding to
FILE - In this June 20, 2014, file photo, Frank Schaefer, a United Methodist Church pastor who was defrocked for officiating his son Tim's wedding to another man, arrives for a Methodist judicial panel appeal hearing on his defrocking in Linthicum, Md. A nine-person church appeals panel on Tuesday, June 14, 2014, overturned the church's decision to defrock Schaefer, who was pastor of Zion United Methodist Church of Iona in Lebanon, Pa. (AP Photo/Steve Ruark, File) (Steve Ruark)

PHILADELPHIA - A pastor who presided over his son's same-sex wedding ceremony and vowed to perform other gay marriages if asked can return to the pulpit after a United Methodist Church appeals panel on Tuesday overturned a decision to defrock him.

The nine-person panel ordered the church to restore Frank Schaefer's pastoral credentials, saying the jury that convicted him of breaking church law erred when fashioning his punishment.

"I've devoted my life to this church, to serving this church, and to be restored and to be able to call myself a reverend again and to speak with this voice means so much to me," an exultant Schaefer told The Associated Press, adding he intends to work for gay rights "with an even stronger voice from within the United Methodist Church."

The church suspended Schaefer, of Lebanon, Pennsylvania, last year for officiating his son's 2007 wedding. It then defrocked him because he wouldn't promise never to preside over another gay ceremony.

Schaefer appealed, arguing the decision was wrong because it was based on an assumption he would break church law in the future.

The appeals panel, which met in Linthicum, Maryland, last week to hear the case, upheld a 30-day suspension that Schaefer has already served and said he should get back pay dating to when the suspension ended in December.

The jury's punishment was illegal under church law, the appeals panel concluded, writing in its decision that "revoking his credentials cannot be squared with the well-established principle that our clergy can only be punished for what they have been convicted of doing in the past, not for what they may or may not do in the future."

The topic of gay marriage has long roiled the United Methodist Church, the nation's second-largest Protestant denomination. Hundreds of Methodist ministers have publicly rejected church doctrine on homosexuality, which allows for gay members but bars "self-avowed practicing homosexuals" from becoming clergy and forbids ministers from performing same-sex marriages.

Traditionalists say clergy have no right to break church law just because they disagree with it. Some conservative pastors are calling for a breakup of the denomination, which has 12 million members worldwide, saying the split over gay marriage is irreconcilable.

Schaefer was charged after a member of his congregation complained to the church about his officiating his son's wedding.

The church can appeal the decision to its highest court, the Judicial Council.