LINTHICUM, Md. — A United Methodist pastor Friday asked a church appeals panel to overturn a decision to defrock him for refusing to promise to uphold the church’s law, which bans ministers from performing same-sex marriages.

Frank Schaefer of Lebanon, Pennsylvania, had his ministerial credentials stripped last year after a trial jury found that he was guilty of violating church rules when he officiated his son’s 2007 same-sex wedding in Massachusetts, where gay marriage had been legal for three years.

The 52-year-old Schaefer was suspended for 30 days, but at the end of it, he was defrocked for refusing to pledge never to officiate at another gay marriage. It means Schaefer is no longer employed with the United Methodist Church.

On Friday, Schaefer’s attorney, the Rev. Scott Campbell, told the nine-member appeals panel in Maryland that the pastor had served his sentence. He argued the decision to take the more drastic action was illegal because it was based on the assumption that the minister would break church rules in the future.

However, counsel for the Eastern Pennsylvania Conference, the Rev. Dr. Christopher Fisher, said the ruling is valid because Schaefer disobeyed church law. He said the 30-day suspension was not a sentence but a delay after which the church would determine whether he could stay in the official ministry.

More than 50 Schaefer supporters wearing multi-colored stoles streamed into a conference room at the BWI Airport Marriott in Linthicum to watch the proceedings.

Campbell told the panel that Schaefer’s sentence was imposed for two violations: officiating a same-sex wedding and disobeying church law. But, he said, the defrocking resulted from “an entirely new allegation: the unwillingness to give the church assurance about the future.”

After his conviction in 2013, when Schaefer was asked if he would promise to obey the “Book of Discipline” in its entirety, which includes a ban on performing same-sex marriages, Schaefer refused.

“Making a statement in response to a question is in no way saying, ‘I will not uphold the Book of Discipline,”‘ Campbell said. “The trial court erred egregiously, and sought to penalize Mr. Schaefer not for what he’s done, but for what he might do in the future.”

But Fisher argued that Schaefer’s 30-day suspension “was a period of grace for Rev. Schaefer to discern his motivations.”

He told the panel that Schaefer’s initial explanation was that he officiated the wedding out of love for his son, but after conviction said he’d discovered a new calling to advocate for the LGBT church community.

“Motivation was an important question for the trial court,” Fisher said.

Fisher went on to argue that Schaefer’s response to the church’s question was “an outright rejection of the Discipline.” Fisher also asked the panel to dismiss the appeal, arguing that because Schaefer did not surrender his credentials voluntarily after refusing to make the promise, as predicated in the jury’s order, he had again broken church rules.

“This is no minor thing,” Fisher said. “Schaefer stated he won’t abide by the Discipline, and demonstrated it by his unwillingness to obey the trial court.”

The topic of gay marriage is contentious in the Methodist Church. Recently, hundreds of ministers have spoken out against the church’s doctrine on homosexuality, which allows for gay members but bars them from becoming clergy, and forbids ministers from performing same-sex marriages.

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

Prior to the hearing, Schaefer on Friday said he is cautiously optimistic, and vowed to appeal to the church’s high court if the decision is upheld.

“I think there will be a victory at the end of the day,” Schaefer said, adding that the LGBT movement is “unstoppable.”

“Things will change,” Schaefer said, “I’m certain of that.”

The appeals panel has 20 days to issue a written opinion.