(RNS) — Gretta Vosper is surprised to still be a minister.

In 2013, she told her congregation that she was an atheist. That led to calls by denominational leaders for her to be fired.

After about five years of divisive discussion and debate, the United Church of Canada has decided to let Vosper remain as a pastor.

“I was very surprised,” she said. “I was totally convinced ... I would end up outside of the church. Every indication suggested that's what was going to happen.”

The unexpected decision was made in November, just prior to a formal hearing to determine her suitability to be a member of the clergy in Canada’s largest Protestant denomination. That hearing was canceled after the two sides reached a settlement.

Vosper's troubles began in 2013 when she publicly declared herself an atheist, despite serving as minister at West Hill United Church in Toronto since 1997.

Things came to a head in 2015 when she issued a public letter denouncing the “existence of a supernatural being whose purposes can be divined and which, once interpreted and without mercy, must be brought about within the human community in the name of that being.”

In 2016, the Toronto Conference — to which her church belongs — conducted a review that found Vosper “not suitable” to continue as a minister because she was no longer in "essential agreement" with the denomination’s statement of doctrine.

The conference also found she was "unwilling and unable" to reaffirm the vows she made when she was ordained in 1993. Conference leaders asked the General Council, the denomination’s top governing body, to conduct a hearing on Vosper’s status.

But before that hearing took place, the Toronto Conference and Vosper reached a settlement on Nov. 7 to let her keep her job.

In a brief joint statement, the Toronto Conference, Vosper and West Hill Church said the parties had "settled all outstanding issues between them."

Terms of the settlement are being kept confidential.

The United Church declined to comment on the settlement.

In an open letter to the denomination, the Rt. Rev. Richard Bott said that there are “a variety of feelings” about Vosper’s ministry. Quoting a previous moderator, he said that the church was struggling with two core values “which are central to our identity.”

The first “is our faith in God,” wrote Bott. “The second is our commitment to being an open and inclusive church.”

The decision about Vosper reveals “the dance between these core values” and “how they interact with and inform each other,” he added.

Vosper said she was unable to discuss the settlement due to signing a nondisclosure agreement. Still, she said, “there's nothing in that that influences what I am able to do. I am able to function in ministry with all the rights and privileges that clergy have.”

She isn’t sure why the church decided to settle but suspects one reason might have been to avoid ongoing negative media attention over the issue.

Vosper also thinks it was because church officials realized she wasn’t about to give up.

“It may have been simply that the church had been betting on my backing down because of the financial burden,” she said. Vosper said she’d run up more than $200,000 in legal bills.

A fundraising group called the Friends of Gretta Vosper has raised about $80,000 of that total, and she and her husband have paid the rest, said Vosper.

Vosper was willing to go through with the hearing even if the ruling went against her. She said she is fit for ministry in the church.

She said she believes what she was taught in seminary.

“Everything I teach is consistent with the theological training I received,” the 60-year-old said. “I was taught the Bible was a human construction, and there is much wisdom in many texts, both ancient and contemporary.”

During her studies, Vosper said she learned that the Bible isn’t the only source of spiritual or moral authority.

“If the Bible is not the authoritative word of God for all time,” she says, “why does it take such a central position in the United Church?”

Despite all that has happened, Vosper said she is still committed to being a minister in the United Church.

She loves her congregation. And the United Church is still her home, despite her disagreements with denominational leaders.

“I still feel that this is my denomination,” she said. “This is my heritage, and to refuse to allow me to participate and continue in ministry felt like a betrayal.”