Cuba has admitted the North Korean cargo ship seized by Panama was loaded with soviet-era weapons from its country.

The Cuban foreign ministry said the 240 tonnes of "obsolete defence machinery" were on their way to North Korea for repair.

"The agreements Cuba has signed in these areas are based on our need to maintain our defensive capacity to protect national sovereignty," the ministry said in a statement.

The statement nonetheless reiterates Cuba's commitment to "peace, disarmament, including nuclear disarmament, and respect for international law".

The confiscated arms include two anti-aircraft missile batteries, nine disassembled rockets, two MiG-21 aircraft and 15 MiG-21 engines.

The shipment was a potential violation of UN sanctions pertaining to Pyongyang's controversial nuclear program. UN experts are to be involved in the investigation over charging the crew.

The Havana government added: "The agreements subscribed by Cuba in this field are supported by the need to maintain our defensive capacity in order to preserve national sovereignty."

North Korean cargo ship Chong Chon Gang
North Korean cargo ship loaded with Cuban weapons - Reuters

The vessel, which is called Chong Chon Gang, was blocked last week in the Panama Canal and the 35-member crew were arrested, even though they initially protested and the ship's captain reportedly attempted suicide.

"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," Panamanian president Ricardo Martinelli said.

The US State Department hailed Panamanian authorities' decision to raid the ship and offered to extend help if requested.

Cuba and North Korea maintain a close relationship, which extends to economic and military ties between the communist countries.

A senior North Korean military delegation is said to have visited Cuba recently, and the countries are believed to have discussed boosting their ties.