A Manhattan-based federal appeals court Friday reversed a series of district court rulings that paved the way for a 2017 jury verdict, which allowed the U.S. government to seize a nonprofit’s majority stake in a 36-story New York skyscraper.

A three-judge panel of the U.S. Court of Appeals for the Second Circuit found a former judge’s “troubling pattern of errors on relatively straightforward issues” had contributed to what prosecutors at the time called the “largest terrorism-related civil forfeiture in U.S. history.”

Now, the Alavi Foundation, a 60% owner of the Manhattan property, will have another chance to clear its name and potentially recover its property interests in the Iranian-linked building.

A federal jury in 2017 awarded the building to the federal government, which had argued that Alavi and the property’s other owner, Assa Corp., had used it as a front for the Iranian government to launder money in violation of U.S. sanctions laws. The verdict allowed victims of Iranian state-sponsored terrorism to enforce civil judgments in their favor.

However, the Second Circuit said Friday that former U.S. District Judge Katherine Forrest of the Southern District of New York had incorrectly denied Alavi discovery on a key defense and had failed to follow earlier instructions on how to treat evidence that was improperly obtained by investigators.

Those and other errors, the court said, were enough to vacate the verdict and remand the case for further proceedings.

“If this case returns to trial, a properly informed jury may or may not find for the government—a topic on which we have no opinion. But getting to any outcome requires a fair and procedurally adequate process, something that has been lacking in this case. There are no shortcuts in the rule of law,” Second Circuit Judge Richard C. Wesley wrote in a 58-page opinion.

John Gleeson and Daniel Ruzumna, who represented Alavi, on Friday welcomed the decision and said they were “obviously pleased” with the result.

“All we have ever wanted and asked for is a fair shake, something the Second Circuit has held once again has been lacking in this case,” they said in a joint statement. “The Alavi Foundation has been devoted to nothing else for more than 40 years but the charitable works it was formed to support, and it looks forward to resuming those works and to ultimate vindication in these cases.”

The U.S. Attorney’s Office for the Southern District of New York declined to comment on the ruling.

The ruling did not apply to Assa, which owns 40% of the building at 650 Fifth Ave. The Second Circuit in a separate opinion Friday upheld the ability of terrorism victims to satisfy their judgments against Iran through Assa.

Alavi has long painted Assa as a co-conspirator with the Iranian government, and argued that it did not know its partner was under the control of the Iranian government.

Forrest ruled against Alvi and ordered the property’s forfeiture in 2013, but the Second Circuit reversed the decision three years later, finding that enough questions remained to merit a new trial. In that ruling, the appeals court ordered Forrest to allow Alavi to litigate its claims that the government’s case was time-barred and to consider whether to suppress evidence from an improper search warrant that was executed in Alavi’s offices.

Forrest, however, blocked Alavi’s motion to compel discovery on its statute-of-limitations defense and to suppress evidence obtained in the illegal 2008 search. The judge did, meanwhile, grant the government’s request to keep two former Alavi board members from testifying at trial and allowed prosecutors to play five videotaped depositions of former board members repeatedly invoking their Fifth Amendment rights against self-incrimination.

On Friday, Wesley faulted Forrest’s “cursory findings” and “limited analysis” when considering Alavi’s motions and said the decision allowing prosecutors to spread a “parade of videotapes” over several days of trial was “substantially more prejudicial and redundant than probative.”

“The district court committed numerous errors requiring us to reverse or vacate several of these orders. These errors also require us to vacate the judgment,” he said.

Forrest retired from the bench last year and is now a partner in Cravath, Swaine & Moore’s litigation department. On remand, the case is assigned to U.S. District Judge Loretta A. Preska.

The case has been pending in the Southern District since the government began seeking forfeiture in 2008. The office tower, the largest single asset seized by the U.S. Justice Department in connection with Iranian sanctions violations, was constructed in the 1970s for the Pahlavi Foundation, a charitable organization formed by the shah of Iran with a New York branch that eventually became Alavi and was financed by a $42 million loan from Bank Melli.

Alavi’s defense team is led by Gleeson, a former Eastern District judge who is now a partner at Debevoise & Plimpton, and Ruzumna, a partner in Patterson Belknap Webb & Tyler’s litigation department and chair of the firm’s white-collar defense and investigations group.

Melissa Ginsberg and Michael N. Fresco of Patterson Belknap and Matthew E. Fishbein, Derek Wikstrom and Justin R. Horton also represented Alavi and the 650 Fifth Avenue Co.

Assistant U.S. Attorneys Michael D. Lockard, Daniel M. Tracer and Daniel B. Tehrani represented the U.S. Attorney’s Office for the Southern District of New York.