Panamanian President Ricardo Martinelli inside the North Korea-flagged ship stopped at his canal. (Screen capture of BBC video)

When Panama detained a North Korea-flagged ship on its way through the canal from Cuba, Panamanian President Ricardo Martinelli flew into action.

A video from inside the ship shows Martinelli investigating the ship personally, poking around the hull of the Chong Chon Gang. He took to Twitter to post a photo of the ship's mysterious cargo, saying it had been hidden under bags of sugar. He referred to the hidden cargo as "undeclared weapons."

According to the military consulting group Jane's, the equipment appears to be RSN-75 ‘Fan Song’ fire control radars for SA-2 surface-to-air missiles.

Martinelli then went on Panama Radio, a national station, to tell the strange story of what happened when the North Korean ship tried to move through the canal – including a disturbing detail about the ship's captain allegedly trying to kill himself to evade capture. Here's what he said:

The world needs to sit up and take note: you cannot go around shipping undeclared weapons of war through the Panama Canal.

We had suspected this ship, which was coming from Cuba and headed to North Korea, might have drugs aboard so it was brought into port for search and inspection.

When we started to unload the shipment of sugar we located containers that we believe to be sophisticated missile equipment, and that is not allowed.

The captain has tried to commit suicide, and the crew rioted [during the Panamanian authorities search].

It's not clear who was shipping the equipment to whom. North Korea's surface-to-air missiles are many but rapidly aging. They could use upgrades, but the country also often ships military technology abroad. NKNews quotes a person familiar with the incident as suggesting these may have actually been sent from North Korea. "Previous reports by the Panel of Experts have shown that the DPRK uses intricate indirect routes for its illegal shipments," the source said. "So although this shipment was coming from Cuba this does not mean that it originated there. Perhaps it was originally from the DPRK and was being shipped via Cuba in an effort to avoid detection."

Panama has long expressed a strongly pro-American foreign policy.

Here are two photos of the Chong Chon Gang, displaying its North Korean origin:

View of North Korean vessel Chong Chong Gang at Manzanillo harbour in Colon, 90 km from Panama City. (RODRIGO ARANGUA/AFP/Getty Images)