The Piaget Building at 650 5th Avenue

A New York court on Thursday ruled a 36-story skyscraper said to be controlled by Iran may be seized by the US government, in what prosecutors called the biggest civil forfeiture linked to terrorism in the country's history.

Proceeds from the sale of the building, valued at between $500 million and $1 billion, will go toward a fund for the compensation of victims of terror attacks, Joon H. Kim, a lawyer from the prosecutor's office said.

A lower court had previously decided the case in the US government's favor in 2013, though its ruling was stayed on appeal.

Victims of the 1983 attack on Marine barracks in Beirut and the 1996 bombing of Khobar Towers in Saudi Arabia stand to benefit.

Tehran has always denied responsibility for both attacks. 

The jury decided that the owners of the property on the city's prestigious 5th Avenue had transferred millions of dollars earned from the tower to Iran via the state-owned Bank Melli Iran.

"The owners of 650 Fifth Avenue gave the Iranian government a critical foothold in the very heart of Manhattan through which Iran successfully circumvented US economic sanctions," said Kim.