A federal appeals court in Manhattan on Tuesday reversed a ruling that had forfeited a Manhattan skyscraper and other properties to the government and families of alleged Iran-sponsored terrorism to help satisfy billions of dollars in claims.

The ruling by the U.S. Second Circuit Court of Appeals said there would have to be a trial on whether the Alavi Foundation, founded by the late Shah of Iran that controls 36-story 650 Fifth Ave. and other properties, was part of a front for the government of Iran.

U.S. District Judge Katherine Forrest in Manhattan ruled in 2013 that undisputed facts established that Alavi and its 40 percent partner, Assa Corp., were so closely linked to the Iranian government and to sanctions violations that a trial wasn’t needed.

In 2014, the government said it would split sale proceeds among victims of the 1983 Beirut Marine barracks bombing, the 1996 Saudi Arabian Khobar Towers bombing and other victims who had sued Iran and obtained default judgments.

U.S. Attorney Preet Bharara said at the time the Fifth Avenue skyscraper built in the 1970s had been part of money-laundering and sanctions-beating schemes by Iran, and the sale would represent the “largest-ever terrorism-related forfeiture.”

The Second Circuit said Forrest needed to hold a trial because there were disputed issues about whether Alavi knew that Assa, its partner, was controlled by Iran’s state-controlled Bank Melli.

The appeals court did not disturb the judgment against Assa, which hasn’t appealed, but it said Forrest also needed to reconsider her approval of a search of Alavi’s offices and a ruling on a possible statute of limitations defense.

In a related decision, the Second Circuit also knocked down a decision by Forrest finding that victims’ families had shown Alavi, Assa and 650 5th Ave. Corp. were “instrumentalities” of a terrorist entity and they could seize the properties as “blocked assets” without a trial.

The court also ordered a trial on those issues.

In addition to 650 Fifth Ave., just north of Rockefeller Center, the case also involves Alavi bank accounts and properties in Maryland, California, Virginia and Texas. Lawyers said the properties likely had a combined value just short of $1 billion.

advertisement | advertise on newsday

Bharara’s office had no comment on the ruling. Ralph DuPont, a lawyer for the families of two victims, described the decision as “procedural” and predicted that after trial the end result would be the same.

“I believe the government will win a forfeiture action,” DuPont said.

Jamie Bernard, another lawyer for victims’ families, said, “We look forward to the trial and recovering this asset on behalf of our clients.”

Daniel Ruzumna, a lawyer for Alavi Foundation, said, “We are very pleased by the rulings of the Court of Appeals. We look forward to vindicating our clients’ rights and interests at trial.”