When a city demolition permit was issued three years ago for the Church of the Assumption, it looked as if it would take a miracle to save the historic Philadelphia sanctuary where the Roman Catholic saint Katharine Drexel was baptized.

That miracle has arrived in the form of a court ruling that appears to void the permit cleared by the Historical Commission in 2010.

Though lawyers on both sides acknowledge that the ruling is confusingly written, they seem to agree that the original demolition permit is no longer valid.

In a decision released Thursday, Commonwealth Court Judge Rochelle S. Friedman concluded that a lower court erred when it upheld the validity of the demolition order this year.

Since the case began, she noted, the Spring Garden Street church has changed ownership, and is now in the hands of local developer John Wei. That alone, Friedman wrote, is enough to make all previous legal arguments in defense of the demolition permit moot.

Andrew Palewski, a local preservationist who has led the effort to save the mid-19th century church, said he was cheered by the ruling despite the ambiguity in the judge's language.

"The way I read this, the clock has been reset," he said.

If he's correct, Wei would have to start the process over by applying to the Historical Commission for a financial hardship waiver.

While Assistant City Solicitor Andrew Ross described the judge's ruling as "rather unclear," he agreed that Wei would probably have to start from scratch if he wants to demolish the building.

Like the previous owner - the social services agency Siloam - he would have to prove that the costs of renovating the building are prohibitive and constitute a financial hardship.

Built in 1848 by the noted church architect Patrick Charles Keely, the ornate church originally served the affluent, ethnic German residents in the Spring Garden Street area. Its interior was lavishly decorated and its sharp twin spires were capped in copper, making them visible across North Philadelphia.

Given that Catholics suffered from discrimination at the time, the prominence of the spires was an important statement. The church also played a role in the lives of Philadelphia's two Roman Catholic saints: The sanctuary was consecrated by Bishop John Neumann and Drexel was baptized there in 1858.

As the neighborhood declined in the late 20th Century, the church lost its congregation. In 2006, the Archdiocese of Philadelphia sold the church and rectory to Siloam. Because of its history and distinctive Gothic Revival architecture, Assumption was declared a city landmark in 2009.

Within a year, however, Siloam applied to the Historical Commission for permission to raze the church, on the ground that it could not afford to maintain it.

The commission approved the request and a demolition permit was issued. But it was immediately challenged by the Callowhill Neighborhood Association and Palewski, who argued that Siloam should have made a better effort to sell the historic building.

At the time, Siloam claimed that it could not find a buyer. A year later, it sold the ochre-colored church to Wei for $1.2 million. Siloam had paid $800,000.

215-854-2213@ingasaffron