An unidentified armed group attacked the Ivory Coast army overnight at Dabou, a southern town near the economic capital Abidjan, military sources and residents said Thursday.
The gunfight followed a recent series of assaults in and around Abidjan, that have seen a sharp rise in tension more than a year after the post-electoral crisis of December 2010 to April 2011 claimed 3,000 lives.
"Our positions were attacked at Dabou on the corridor leading into the town," said a source in the Republican Forces of Ivory Coast (FRCI).
"But the situation is under control. Our men pushed back the attack. A sweep (for the assailants) is under way," he told AFP.
The local paramilitary police headquarters and the town prison also came under attack, according to a source in the security forces.
There were no human losses, the military source said, but it was not possible to obtain independent confirmation on whether there were casualties.
A resident of Dabou, about 50 kilometres (30 miles) west of Abidjan, said: "Since yesterday at 23:00 (GMT and local time) we have been able to hear very heavy firing.... It has continued this morning, no-one can go out, we are holed up in our homes."
Other residents gave similar accounts, but said the heavy weapons fire in the morning gave way to sporadic gunfire, mostly near some strongholds of the security forces.
"We can still hear some shooting, but it is far away and no longer steady," said a resident of the town centre.
It was the latest violence around Abidjan, where 10 soldiers were killed on August 5 and 6, mainly in an army base.
The government blamed supporters of ousted president Laurent Gbagbo, who sparked the 2010-11 electoral crisis by refusing to admit defeat at the polls to current President Alassane Ouattara.
The Ivorian Popular Front, formerly Gbagbo's party, has denied the government claims and demanded inquiries.
Gbagbo is now being held by the International Criminal Court in The Hague, where he faces trial for alleged crimes against humanity.
Ivory Coast's army also came under attack last Monday at a border post with Liberia in the volatile west, which has seen several outbreaks of violence in recent months.
Six Ivorians suspected of being involved in this operation were arrested in Liberia close to the border, Liberian authorities announced, adding that two of the men were armed.