(CNN) -- North Korea will pay a fine of more than half a million dollars next week for the release of a ship that last year tried to cross the Panama Canal with weapons smuggled aboard, Panamanian authorities said.
Panama stopped the North Korean cargo ship, the Chong Chon Gang, in July and found undeclared weaponry from Cuba -- including MiG fighter jets, anti-aircraft systems and explosives -- buried under thousands of bags of sugar.
The Cuban government said the shipment consisted of "obsolete" weapons being sent to North Korea for repairs before being returned to Cuba. But Panama said they violated United Nations arms sanctions on North Korea.
Panamanian authorities had originally imposed a $1 million fine on North Korea over the shipment, which they said violated the security of the canal, a key waterway linking the Atlantic and Pacific Oceans.
That fine has now been reduced by a third to $666,666, and the North Korean government has pledged to pay it next week, Panama's Foreign Ministry said in a statement Thursday.
Panamanian Foreign Minister Fernando Nunez Fabrega said 32 of the ship's 35 detained crew members would also be allowed to leave the country.
The three remaining crew members face charges of threatening collective security, he said.
Because it is pursuing nuclear weapons, North Korea is banned by the United Nations from importing and exporting most weapons.
CNN's Pierre Meilhan contributed to this report.