TORONTO -- A United Church minister who had faced an unprecedented ecclesiastical court hearing over her professed atheism is no longer in danger of a defrocking after the two sides reached an agreement in the long-running case.

In an unexpected development this week, Rev. Gretta Vosper and the church settled ahead of what some had dubbed a "heresy trial," leaving her free to minister to her east-end Toronto congregation.

"It's going to be wonderful," Vosper said in an interview Friday. "We'll be out from underneath that heavy cloud. Now we'll be able to really fly."

The settlement, the terms of which are confidential, came during what was supposed to be a week of routine preliminary motions ahead of the full hearing later in the month.

The church did not immediately respond to a request for comment Friday but said in a statement that the formal hearing had been called off in light of the agreement, while the Right Rev. Richard Bott, who was elected in July to lead the United Church in Canada, said in a public message that he was pleased with the resolution.

At the same time, Bott acknowledged the controversy that has been swirling around Vosper and the church's initiative to fire her. In a message to adherents, Bott referenced the church's core values of faith in God and inclusiveness.

"The dance between these core values, how they interact with and inform each other, is one that we continue to explore as followers of Jesus and children of the creator," he said. "As a Christian church, we continue to expect that ministers in the United Church of Canada will offer their leadership in accordance with our shared and agreed upon statements of faith."

Vosper, 60, who was ordained in 1993 and had served as minister of West Hill United Church since 1997, has been upfront about her atheism and non-belief in the Bible for years.

Most of her current congregants are supportive of her views but some have been critical, saying her beliefs are at fundamental odds with the doctrine and values of the United Church, Canada's second-largest religious denomination.

Things came to a head after she wrote an open letter to the church's spiritual leader following the Charlie Hebdo massacre in Paris in January 2015 in which she pointed out that belief in God can motivate bad things.

Following complaints, the Toronto Conference interview committee conducted a review that found in a split decision in 2016 that Vosper was unsuitable to continue in ordained ministry because "she does not believe in God, Jesus Christ or the Holy Spirit."

Vosper's lawyer, Julian Falconer, called it an important day for the United Church that his client no longer was risk of sanction.

"Both parties took a long look at the cost-benefit at running a heresy trial and whether it was good for anyone (and) the results speak for themselves," Falconer said. "They recognized there's a place for Gretta, and that there is no reason to separate the minister and the congregation."

Vosper, who was allowed to keep her position pending outcome of the aborted hearing, is free to continue her ministry without any restrictions. She calls herself an atheist to describe her non-belief in a theistic, interventionist, supernatural being called God.

Critics have called it appalling that the church would allow an atheist to stand in a pulpit and not proclaim the Gospel of Christ. Either way, Vosper said it's been a long road to clearing her name.

"There have been times of elation when I have felt the incredible support and energy of that support and love and affirmation from my congregation and across the country and around the world," she said. "And there have been moments of incredible despair."