A Greek shipping company admitted to violating US sanctions on Iran by transporting oil from the Middle East country in an agreement with the US that was kept under wraps for almost five months amid fears of Iranian retaliation.

Empire Navigation Inc. entered into a deferred prosecution agreement with the US on April 19, pledging to transport almost 1 million barrels of the illicit Iranian oil to the US for seizure and forfeiture, according to a recently unsealed court filing in Washington federal court. Under the accord, the US won’t prosecute the company in exchange for its cooperation.

The US government had asked the court to seal the proceedings given that “revelation of this action was likely to cause security risks to the defendants, the government, as well as the vessel and its crew members,” according to the filing.

The cargo was on an oil tanker named Suez Rajan, which was suspected of carrying Iranian oil and became embroiled in wider tensions between the US and Iran. The US seized the tanker in April while it was en route to China, prompting Iran to take a US vessel called the Advantage Sweet, which was carrying Kuwaiti oil for Chevron, the Financial Times reported in June.

Iran’s oil exports have been a target of sanctions imposed on the country over its nuclear program, with the US and its allies trying to prevent Iran from using its energy technology to develop nuclear weapons.

“Due to the public attention this matter has received and the threats of retaliation by the Iranian government, the government seeks the ability to publicly comment on this operation, and the sealed materials, at such time as would minimize risks posed by the threat of Iranian retaliation,” the US said in the unsealed filing.

The matter could be made public when the oil was offloaded, the US said.

Suez Rajan Ltd., the operator of the tanker, pleaded guilty.

The case is US v. Empire Navigation Inc., 1:23-cr-00088, US District Court, District of Columbia (Washington).