WASHINGTON — The U.S. said Thursday that it has seized a North Korean cargo ship that was used to violate international sanctions, a first-of-its kind enforcement action that comes amid a tense moment in relations between the two countries.

The Wise Honest, North Korea’s second largest cargo ship, was detained in April 2018 as it traveled toward Indonesia. It’s now in the process of being moved to American Samoa, Justice Department officials said.

Officials made the announcement hours after North Korea fired two suspected short-range missiles toward the sea, the second weapons launch in five days and a possible signal that stalled talks over its nuclear weapons program are in trouble. The public disclosure that the vessel is now in U.S. custody may further inflame tensions, though U.S. officials said the timing of their complaint was not a response to the missile launch.

Justice Department lawyers laid out the case for confiscating the ship in a complaint filed in New York, arguing that payments for maintenance and operation of the vessel were channeled through unwitting U.S. financial institutions in violation of American law. The coal trade itself is also believed to fund the isolated country’s nuclear weapons and ballistic missile programs.

“This sanctions-busting ship is now out of service,” Assistant Attorney General John Demers, the Justice Department’s top national security official, told reporters. He later added: “The U.S. sanctions against North Korea reflect the threat these programs pose to U.S. national security.”

The 581-foot Wise Honest was used for coal transports to ports in China, Russia and other countries, according to the complaint, generating badly needed revenue to a country that is under U.N. sanctions because of its nuclear weapons program. The ship also delivered heavy machinery back to North Korea.

The vessel was owned by a subsidiary of a North Korean shipping company that is controlled by the country’s military and is on a Treasury Department sanctions list, officials said.

North Korea sought to disguise the nationality of the ship and the origin of its cargo, according to the complaint. The ship, in what U.S. officials say was a clear act of concealment, also turned off an automatic signal system intended to alert other ships of its course and location.

Indonesian authorities intercepted and seized the Wise Honest in the East China Sea a month after it was photographed at the port of Nampo, North Korea, where it took on a load of coal. The captain of the ship was charged in Indonesia with violating that country’s maritime laws and convicted, the complaint says. It was not immediately clear what happened to the rest of the crew, which at least at one time totaled two dozen members.

The U.S. has prosecuted people and businesses for violating sanctions but has never before seized a North Korean ship. The country will have an opportunity to contest the seizure in court. If the U.S. prevails, it will be able to sell the vessel.

“When nations who have stated an intent to do harm to the United States evade international sanctions, Americans become less safe,” said Geoffrey Berman, the United States attorney for the Southern District of New York.

Asked whether North Korea’s largest merchant ship was similarly involved in illegal coal exports, Demers said that he did not know, but added, “If it is, we’d love to get our hands on it.”

President Trump and North Korean leader Kim Jong Un have held two summits focused on the North’s nuclear program but have made no discernible progress toward a deal that would eliminate its weapons. At the White House on Thursday, Trump said the U.S. was looking “very seriously right now” at North Korea’s recent military tests.

“Nobody’s happy about it.”