Panama says it will release 32 crew members, but that the captain and two others will remain in custody to face charges of trafficking.
The container ship, the Chong Chon Gang, was stopped on the Atlantic side of the Canal in July. Officials said its cargo — which reportedly included 25 containers of military hardware, including two Cold War-era MiG-21 fighter aircraft, air defense systems, missiles and command-and-control vehicles — had endangered Panama's internal security.
The weapons were found in the ship's hold stored under hundreds of bags of sugar.
Havana had said at the time that it was sending the "obsolete" defensive weapons to North Korea to be repaired, a view echoed by North Korea's state-run Central News Agency.
But a U.N. team sent to investigate issued a preliminary reporting saying the shipment violated sanctions imposed over North Korea's nuclear program, which bans weapons exports and the import of all but small arms, the BBC says.
The BBC says that earlier this month, the ship's owners agreed to pay $670,000 to have it released, sans the cargo.
The captain and the two other crew members face a possible 12-year sentence in Panama if convicted on charges of arms trafficking.