TORONTO — An Ontario court ordered the seizure of more than $7 million in assets belonging to Iran to compensate American victims of terror.

The historic ruling last week brought to an end several lawsuits filed in Canada by terror victims from the United States seeking damages from Iran for training, arming and financing the Hamas and Hezbollah terror groups.

The Americans previously were awarded damages by US courts but could not collect from any Iranian government assets in the United States. They came to Canada for enforcement, which was made possible by Ottawa’s passage in 2012 of the Justice for Victims of Terrorism Act. The law strips state immunity in civil lawsuits from countries deemed to be “supporting terrorism.”

The Ontario court ordered sheriffs to seize one bank account worth $1.47 million controlled by an Iranian diplomat, and another with a balance of $511,000 controlled by Iran’s charge d’affaires in Ottawa.

The evidence “overwhelmingly” established that the money in the accounts was the property of Iran, the judge ruled.

Also to be sold, with the proceeds going to the victims, are a building in Toronto valued at $1.1 million and another in Ottawa valued at $3.9 million. Both facilities operated as ostensible cultural centers. The judge noted there was evidence that the Ottawa property was owned by a front group linked to the Iranian Revolutionary Guards, which is “hardly a cultural or charitable organization.”

The plaintiffs in the case, believed to be the first of its kind in Canada, were Edward Tracy and the family of Joseph Cicippio. Both US men were captured and held hostage in Beirut from 1986 to 1991.

“I’m surprised. I’m shocked that we’ve gotten this far after all these years,” Cicippio told the Canadian Broadcasting Corp.

Cicippio’s family was awarded $91 million in damages in 2005 but could not collect in the United States. Tracy won a judgment of $18.5 million in 2003.

It is expected that other victims of terror in separate cases, including a Canadian dentist wounded in a 1997 Hamas suicide bombing in Jerusalem, and three other American families will share in the proceeds as part of a side deal worked out among  lawyers.

The other Americans suing in Canada were Alann Steen, who was abducted in Beirut in 1987 and held for nearly five years; the family of David Jacobsen, who was kidnapped in 1985 and released 17 months later; and the family of Marla Bennett, a California student killed in a 2002 bombing attack by Hamas at Hebrew University in Jerusalem.

All won sizable awards in US courts but could not collect.

Over the weekend, Iran’s state-controlled media blasted the Canadian ruling as “politically motivated” and of “no legal value.” No representative of the country attended the court hearing.