SEOUL, South Korea — North Korea on Tuesday demanded the release of a ship impounded by the United States for evading international sanctions, calling the seizure a “flagrant act of robbery” that violated the spirit of the agreement reached last year between the North’s leader, Kim Jong-un, and President Trump.

American prosecutors say the North Korean ship, the Wise Honest, was used to export coal and import heavy machinery in violation of sanctions imposed on the North over its nuclear arms program. The ship was detained in Indonesian waters by the authorities there in April of last year, and its seizure by the United States was announced last week. The ship has since been taken to American Samoa.

“The United States’ action is an extension of its calculation aimed at subjugating us through the so-called maximum pressure and flatly denies the spirit of the June 12 Joint North Korea-U.S. Declaration where both sides agreed to build new relations,” the North Korean Foreign Ministry said in a statement, referring to the broad agreement reached between Mr. Trump and Mr. Kim at their first meeting, in Singapore.

“The United States must mull over what repercussions its gangster-like act will entail, and must return our vessel without delay,” the ministry said.