Gunfire and heavy explosions shook the military barracks at Akuedo, located in northeastern Abidjan, for about an hour before a tense calm returned to the area on Monday.
General Phillipe Mangou, chief of the armed forces, went on state television afterwards to reassure residents, saying military forces had repulsed the attack.
Colonel Hilaire Gohourou Babri, an army spokesman, said seven of the attackers and three members of the security forces were killed in the battle.
Babri said dozens of the attackers had been arrested. He ruled out rumours that there had been a mutiny, but there was still no word on who carried out the assault, the first since a new national unity government took office last week to help steer the country towards delayed elections due later this year.
Ivory Coast has been split between a rebel-held north and a loyalist south since a failed coup in 2002 sparked days of fighting in Abidjan.
Mangou called on residents living near Akuedo to remain indoors while security forces conducted a search for the assailants, some of whom he said had fled in civilian clothes.
"I wanted to reassure the population and tell them the situation is under control," Mangou said. "Our elements effectively control Camp Akuedo."
Elsewhere in the city, paramilitary police set up roadblocks and tanks were deployed around the national television station.
The latest violence was sure to raise tensions in the country, which has been on edge since Laurent Gbagbo, the president, cancelled elections planned for October, blaming the war and rebels' failure to disarm.
The United Nations and the African Union later endorsed a year's extension of Gbagbo's five-year mandate, against the protests of rebels and opposition leaders.
Last week, a new 32-member national-unity government composed of rebel, opposition and ruling-party ministers took office. A new prime minister, Charles Konan Banny, was chosen by the warring sides to arrange the new cabinet.
Guillaume Soro, a rebel leader, was named minister of reconstruction, while Gbagbo loyalists and foes were among the new ministers.
Later in the day, Gbagbo toured the two military barracks.
About 10,000 peacekeepers - both French and United Nations forces - are deployed in the country.