Minneapolis officials erred when they denied a permit to demolish a historic former church whose condition has deteriorated for years, the Minnesota Court of Appeals ruled this week.

"We reverse the City of Minneapolis's decision … because the denial was unreasonable, arbitrary, capricious, and not supported by substantial evidence," retired Judge John Smith wrote on behalf of the court.

The fight over the fate of the former First Church of Christ, Scientist in Elliot Park tested the city's preservation rules, which are generally designed to preserve historic buildings but also contemplate rare cases in which they could be demolished.

Constructed in 1897, the building at 614 E. 15th St. was the first church of its denomination in Minnesota. It received local historic status in the 1980s and today is one of roughly 200 locations in the city with that designation.

The church was once stately, featuring a pristine grand sanctuary and a prominent stone staircase in front. But the building has sat vacant for 15 years. Graffiti and vines have overtaken parts of its walls, and water has seeped through the roof. Metal supports were eventually installed to prevent a collapse.

Weidner Apartment Homes, which is helping to develop an adjacent apartment building, bought the former church several years ago with initial plans for possible restoration. Weidner later asked the city for permission to demolish the building, but the citizen-led Heritage Preservation Commission and the City Council denied that request.

The developers filed an appeal in court. Their attorney, Stuart Alger, argued that the city's decision was "arbitrary" and "capricious" and made it impossible to demolish the building. The city's attorneys disputed that characterization and said they had a rational basis for denying the permit.

The judges — Smith, as well as judges Renee Worke and James Florey — sided with the developers, saying they "presented significant evidence of the deterioration and high cost of rehabilitation of the building." Some estimates put the price of repairs at roughly $4.2 million.

The city had argued that it might be possible to use the building for another purpose, but the court said that argument "was based on conjecture and speculation" and "does not acknowledge that alternative uses of the building other than office space 'would cost nearly the same but returns significantly less revenue.'"

The city attorney's office declined to comment Tuesday. An attorney for the property owners couldn't be reached.