NASHVILLE, Tenn. – A Methodist pastor who was disciplined after he officiated at the wedding of his gay son will be allowed to remain an ordained minister.

The Judicial Council of the nation’s second-largest Protestant denomination ruled Monday that a Pennsylvania church jury was wrong to defrock Frank Schaefer last year after he would not promise never to perform another same-sex wedding.

The council ruled on technical grounds and did not express support for gay marriage in general. Its decision is final.

Although the United Methodist Church has welcomed gay and lesbian members, the church’s Book of Discipline rejects sex outside of heterosexual marriage as “incompatible with Christian teaching.”

Since his church trial, Schaefer has become a gay rights activist, galvanizing other Methodists who support full inclusion of gays and lesbians in the church.

Following his Wednesday hearing before the Judicial Council, Schaefer sa id he had no regrets for his actions.

When his son first came out to him as gay, Schaefer said he learned that church doctrine had made his son believe he could not go to heaven.

“He did not want to live any more. He was in so much pain,” Schaefer said. So when his son asked Schaefer to officiate at his wedding, the minister accepted. “I did what I did based on my heart and my conscience.”

However, Schaefer hid his son’s 2007 wedding from his conservative Pennsylvania congregation. The small, private ceremony was held in a restaurant in Massachusetts, where gay marriage had been legal for three years. Schaefer’s actions did not become public until 2013, after a member of his congregation learned of the wedding and filed a complaint.

The United Methodist Church, with more than 12 million members worldwide, has been debating its policy on same-sex relationships for four decades, but recently frustration with the current policy has fueled a movement to o penly defy church law.

Less than a month ago, the denomination announced a settlement with 36 United Methodist ministers who blessed a same-sex wedding in Philadelphia last year, in part as a show of support for Schaefer. The wedding was ceremonial because Pennsylvania’s gay-marriage ban was still on the books at the time.

The ministers faced no discipline for breaking church law, but acknowledged they could be punished if they did it again, according to a settlement announced by the denomination.

Meanwhile, supporters of the church’s stance on same-sex relationships have been pressing church leaders to punish ministers who violate church law. And some conservative pastors have called for a breakup of the denomination, saying the split over gay marriage is irreconcilable.

In its Monday decision, the Judicial Council noted that some might view the decision as a “flagrant disregard” for church discipline, while others will support it. “We are mindful of the divisions within our church,” the decision reads.

The council essentially found that Schaefer was subjected to two distinct punishments for the same violation. First, he was given a 30-day suspension. Then he was defrocked after he would not promise to uphold the church’s Book of Discipline “in its entirety.” That second punishment was wrongfully imposed for a possible future violation.

The Rev. Christopher Fisher, who argued before the Judicial Council that the church jury was within its rights to defrock Schaefer, said he was disappointed in the decision.

“I understand the legal technicality they have hinged it on,” he said. But he also said that it was not clear to the church jury that the penalty they imposed was not allowed.

Schaefer, who was transferred to a California ministry in July, hopes the church will change its stance. He has been traveling the country giving talks and sermons on gay acceptance. And last month, he released a book ab out his experience – “Defrocked: How a Father’s Act of Love Shook the United Methodist Church.”

He could not immediately be reached for comment on Monday.