One assailant was also killed in the gun battle which lasted several hours in the Riviera district of Abidjan.
This follows the shooting of five soldiers on Sunday in an attack on a police station and an army checkpoint in Yopougon to the east of the city.
It is not clear who was behind the attack. Ivory Coast is recovering from months of unrest after a disputed poll.
The two attacks are said to be the biggest in Abidjan since former President Laurent Gbagbo was ousted in April 2011.
The BBC's John James in Abidjan says there is a gory scene at the Akouedo military camp, with bodies lying on the ground and blood spattered over the walls.
Corp Ousmane Kone, who took part in the fighting, told Reuters news agency that the attackers had made off with guns.
"They took lots of weapons, loaded them in a truck and drove off with them. They took AK-47s [automatic rifles], machine guns and rocket-propelled grenades," he said.