Bamako (AFP) - The central Malian town of Boni was under jihadist control on Friday after administrative buildings were attacked and the army driven out, an elected official and a security source told AFP.

Boni is home to several thousand people and remained under the control of the unidentified armed group by nightfall, who fired on administrative buildings and torched the mayor's office in the afternoon.

"At the moment jihadists are in control of the town of Boni. They infiltrated the town and today fired on several buildings," an elected official who requested anonymity said, adding: "the army is no longer there."

Ongoing international military intervention since January 2013 has driven Islamist fighters away from major urban centres which they had briefly controlled, but large tracts of Mali are still not controlled by domestic or foreign troops.

Jihadist groups early last year began to carry out attacks in central Mali as well as the long-troubled north.

"We asked our forces present in Boni to withdraw to the locality of Douentza, which has been done," a military source told AFP, also asking not to be named as the Malian army has refused to comment on the incident.

Douentza is around 90 kilometres (56 miles) from Boni.

Residents reached by phone described men entering the town riding motorbikes and carrying weapons, shouting "Allahu Akbar" during the attack and flying several jihadist flags.

"They set fire to the police chief's house, as well as the mayor's office. They kept firing in the air," the resident said.

"I saw the army leave the town," he added. "Some jihadists were on motorbikes and had accomplices inside the town. It was planned."

Lawmakers in Mali agreed to extend a state of emergency across the country in July, after attackers stormed an army base in Nampala, also in the centre, leaving 17 soldiers dead and 35 wounded.

Two groups -- the Islamist organisation Ansar Dine and a newly formed ethnic group -- claimed to have carried out that raid, which the government described as a "coordinated terrorist attack".

Attacks have become more frequent near Mali's borders with Burkina Faso and Niger, both from criminal and jihadist elements.

Long prey to rival armed factions, plagued by drug trafficking and at the mercy of jihadism, Mali has struggled for stability since gaining independence from France in 1960.