PANAMA CITY - Panamanian authorities seized a North Korean-flagged ship carrying undeclared military cargo from Cuba hidden in a shipment of sugar and have detained its crew while continuing to search the vessel.

Officials searched the ship on the Atlantic Ocean side of the Panama Canal because they suspected it was carrying illegal drugs, President Ricardo Martinelli told RPC Radio on Monday.

The ship's captain tried to commit suicide and about 35 crew members were detained, he said.

Photos taken of the captured vessel, the Chong Chon Gang, show what appears to be a fire-control radar for upgrading the Asian nation's surface-to-air missile defense system, said Neil Ashdown, an analyst at IHS Jane's.

UN sanctions forbid North Korea from buying or selling ballistic missile or nuclear technology.

"We've only seen these three pictures, so it's entirely possible that there are other things in the shipment that would be a weapon or surface-to-air missile," Ashdown said in a phone interview from London. "This is definitely a component for a military system."

The crew had a "hostile attitude" toward Panamanian authorities and sabotaged the boat to make it harder to inspect, Security Minister Jose Raul Mulino said in a phone interview from Panama City.

"For all practical purposes, we have to take one bag out at a time," Mulino said.

The government is seeking assistance from the U.S. and other countries in inspecting the vessel, he added.

It may take several days to inspect the ship, said Steve Atkiss, a former chief of staff for U.S. Customs and Border Protection who advises Panama's government.

"We found this one system so far, but it's going to take five to seven days to dig everything out," Atkiss, a partner with the Washington-based Command Consulting Group, said in a phone interview. "North Korea has a history of violating U.N. sanctions that prevent the sale of their weapons system."

The missile system could have been loaded before it docked in Cuba to be sold to another foreign country, Atkiss said.

U.S. Defense Secretary Chuck Hagel said Panama "did the right thing" in stopping the ship.