The United States won a federal court battle on Monday to take ownership of a North Korean ship that was seized last year for violating U.N. economic sanctions.

It's the first time the United States has taken possession of a North Korean ship for violating international sanctions, federal prosecutors said.

The 17,000-ton cargo ship, the Wise Honest — North Korea's second-largest ship for carrying bulk cargo — was on its way to American Samoa when it was stopped in Indonesia in April 2018.

Indonesian authorities found it to be carrying coal, which the United States said violated U.N. sanctions. The United States soon filed an action to seize the ship, and Indonesia transferred it to U.S. marshals in April of this year.

The United States filed a civil forfeiture complaint to take ownership of the Wise Honest in May.

But in July, two federal judges, one in New York and one in Washington, ordered that it be sold to pay for court judgments won by the families of two victims of North Korean torture — Otto Warmbier, the U.S. college student who died in 2017 following 17 months of torture, and the Rev. Dong Shik Kim, whom North Korea tortured before executing in 2000.

Download the NBC News app for breaking news

In a three-page order published Monday in U.S. District Court in Manhattan, Judge P. Kevin Castel said both families had resolved their claims to speed the forfeiture of the ship.

John Demers, the assistant attorney general for national security, said in a statement that the forfeiture "sinks the Wise Honest's career as one of North Korea's largest sanctions-busting vessels."

The Justice Department said in a court filing that the Coast Guard has already sold the ship, without disclosing the buyer. Neither prosecutors nor the judgment addressed how much money the Warmbier and Kim families could collect from the sale.

North Korea is banned from exporting coal under U.N. sanctions to punish increasingly powerful weapons tests. In March, a United Nations report exhaustively detailed North Korea's use of exports of coal and other minerals to help finance its weapons industry.