President Ricardo Martinelli told local media that the ship, which was sailing from Cuba, contained suspected “sophisticated missile equipment”.
He posted a photo of what looked like a large green object inside a cargo container on his Twitter account.
He said the ship, which was searched on its way into the Panama Canal, was being held for further investigation.
The ship was stopped near Manzanillo on the Atlantic side of the canal.
Mr Martinelli said the authorities were checking the ship for drugs when they found the suspected weapons in containers of brown sugar.
“We’re going to keep unloading the ship and figure out exactly what was inside,” he told local media.
The 35-member crew have been detained, including the captain who the Panamanian president said tried to kill himself during the search.
Security Minister Jose Raul Mulino said the ship “aroused suspicion by the violent reaction of the captain and the crew”.
Read more at BBC.co.uk.