The Chong Chon Gang freighter departed from the Panamanian port of Colon with a crew of 32 on its way back to Cuba, the ministry said in a statement.
The ship got the green light last week to leave Panama after Pyongyang paid a fine of nearly USD 7,00,000.
Back in July, en route from Cuba, the ship was stopped on suspicion of carrying drugs as it tried to enter the canal, the busy waterway linking the Caribbean and Pacific.
The containers were concealed under more than 2,00,000 sacks of sugar.
More From This Section
Both Havana and Pyongyang said the weapons were obsolete Cuban arms being shipped to North Korea for refurbishment under a legitimate contract and due to be returned to Cuba.
But neither country explained why the shipment was hidden if it was indeed legitimate.
The seized cargo has remained in Panama pending a court ruling on what to do with it.
The foreign ministry said that once the vessel arrives in Havana, it will be loaded with a shipment of sugar destined for North Korea.
The remaining three -- the vessel's captain, first officer and political secretary -- are still in custody in Panama, facing trial on arms trafficking charges.
The sailors on their way to Cuba "are happy because this affair in which they have lost seven months of their lives has finally come to an end," said a lawyer for the crew, Julio Berrios. He said they felt their long detention was unjust.
Panama asked the United Nations to send a mission to determine if the attempted shipment violated a UN embargo on arms deliveries to North Korea.