A Panamanian judge absolved three crew members of a North Korean ship seized in Panama in 2013 on arms-trafficking charges but ordered the arsenal retained.

Judge Carlos Villarreal in the northern city of Colon also ordered the return of the more than 10,000 tons of sugar, under which Panamanian authorities discovered the hidden arms, in a matter involving the U.N. Security Council.

The North Korean-flagged Chong Chon Gang was detained by authorities in Panama in July 2013 on suspicion of transporting drugs, but what they found during the inspection was an undeclared weapons cargo that Cuba later admitted it was sending to North Korea to be repaired and returned because the arms were "obsolete."

Panamanian judicial authorities said in a statement Friday that the judge ordered the "immediate release" of the ship's captain, Ri Yong Il, and two other officers.

Villarreal had earlier absolved the other 32 crew members of the Chong Chon Gang, who were released on Jan. 30 and left the country two weeks later on the ship, which sailed to Havana, officials said at the time.

The judge ordered the return of the more than 200,000 sacks of sugar under which the Cuban arsenal was hidden, and which Havana said it sold to North Korea.

The Panamanian judge ordered the "confiscation" of all the war materiel "from the ship Chong Chon Gang...since its legitimate owner has not been identified," according to the sentence.

"Judge Villarreal's decision is based on the fact that this incident (the case of the North Korean ship) is of an international nature and therefore not under Panamanian jurisdiction," the verdict said.

A United Nations team that traveled to Panama in August said in a preliminary report that the attempted shipment violated resolutions barring North Korea from importing or exporting weapons of any kind.

According to the U.N. inspectors, the Cuban arsenal includes six vehicles associated with ground-to-air missile systems and 25 containers loaded with the parts of two MiG-21 jet fighters.

The Chong Chon Gang returned from Havana in early May and passed through the Panama Canal without any problem en route to North Korea, according to official records. EFE