After years of quarreling and questions about the viability of saving St. Laurentius, the abandoned Fishtown Catholic church may have finally received the small miracle it needed.

On Monday, the Archdiocese of Philadelphia sold the 19th-century Polish church to a New Jersey developer, who said Tuesday that he is committed to trying to save the stone building with an eye toward turning it into offices.

Humberto Fernandini, the developer, who has been active in Philadelphia for roughly 10 years, said he purchased the church this week after the development team that initially tried to save it transferred to him its agreement of sale.

“I love the church itself. I think it’s an amazing project, and I was sort of enamored with the building,” Fernandini said. “We are committed to keeping the church standing; however, we are still evaluating the structural integrity of [the building’s] towers.”

The transaction, confirmed by the archdiocese, is a significant milestone for the building, which has been embroiled in controversy and has faced the possibility of demolition since it decided to close the church in 2014. At the time, the archdiocese said the building was beset by “vertical cracks” and a “heavily deteriorated” facade, putting it “in danger of collapse.”

On Tuesday, Philadelphia developer Leo Voloshin said he was no longer involved in the project, and was “really happy that the transaction has closed.”

A spokesperson for the archdiocese said in a statement that “while it is disappointing that this day did not come much sooner, due to a variety of challenges, all are relieved that the building has been sold.”

At times in the nearly six years since the closure, it seemed that St. Laurentius’ fate was set, including in 2015, when the archdiocese moved to demolish it. But an effort by residents and preservation advocates to designate the building as historic was fast-tracked. In 2015, the Historical Commission added St. Laurentius to Philadelphia’s historic register, which gave the landmark some protection from demolition and offered hope for its future.

Over the years, however, St. Laurentius, at Berks and Memphis Streets in fast-changing Fishtown, faced a series of setbacks that threatened its reuse.

Though Voloshin and Linden Lane Capital Partners stepped forward to redevelop and preserve the church, their efforts were stymied by a lawsuit that sought to stop Voloshin’s proposal for apartments from moving forward. Then, on two occasions stones tumbled from the side of the building to the ground.

Finally, last March, the Department of Licenses and Inspections said the stones that cover the towers were expected “to fail at an accelerating rate.” A separate report submitted last month to L&I implied largely the same.

Over time, St. Laurentius became a poster child for how difficult it can be to preserve buildings in Philadelphia, a city that ranks among the most historic places in the United States. Developers often say that it can be too expensive, or that the the city’s zoning process can take months to navigate. A trio of bills signed into law last year by Mayor Jim Kenney aim to make preservation easier, though advocates say more can be done.

Still, had one of the bills that Kenney signed been implemented earlier, Voloshin and Linden Land might have had more success with their proposal. The bill, introduced by Councilmember Mark Squilla, gives historic “special-use properties” — churches and theaters, for example — more flexible zoning options without a variance.

Voloshin had sought a variance to redevelop the church into apartments but was blocked by an appeal from a group of neighbors, the Faithful Laurentians, who said they wanted to see the church maintained as a sacred place. By the time a state court rejected the group’s appeal, the cost to save the church, according to Voloshin, had significantly grown.

Fernandini said that he and Voloshin are friends and that he decided to take over Voloshin’s agreement of sale. He said he was “considering making [the church] into offices with perhaps a small cafe” on the first floor.

St. Laurentius, built in 1882 and paid for by Polish immigrants who sought their own place of worship, has long served as a reminder of the neighborhood’s roots. Fernandini said its origins hit home: His wife and her parents are of Polish descent.

“I told them I had this Polish church, and they almost collapsed. They were overjoyed,” Fernandini said.

Still, questions remain about the safety of the church’s Gothic towers. In March, L&I said it might be “compelled to order the demolition of the north towers in the interest of public safety.” However, in December, L&I said that the church was in better shape after the archdiocese spent roughly $135,000 repairing the facade over the summer.

Fernandini said he will soon seek opinions from other structural engineers to determine the towers’ safety. St. Laurentius will be his first major redevelopment of a historic structure, Fernandini said.