Boko Haram invaded the restive northeastern Nigerian city of Gombe on Saturday and warned residents against voting in next month?s elections as the Islamists defied regional force aiming to pursue them.
Residents said the attackers later left the city and stormed another area some 40 kilometres (25 miles) away, where they burned homes.
The violence prompted the state governor to impose an around-the-clock curfew.
Witnesses said the extremists stormed the city at around 9:00 am (0800 GMT) and advanced without any resistance from the security forces. It was unclear if there were casualties.
A Nigerian fighter jet encircled the city but did not appear to attack the insurgents, said witness Kabiru Na-Gwandu, adding that he had received a call from friends outside of Gombe warning him the gunmen were on their way.
?I evacuated my house along with my family before they arrived in the city and I?m happy that I did because from information I?m receiving they have taken over the military barracks,? he said.
The Boko Haram fighters called on residents to boycott elections which had originally been planned to take place on Saturday before they were postponed until March 28.
?Whoever professes Islam should distance himself from polling stations because we are going to attack polling booths,? read the Boko Haram leaflets.
Residents said the gunmen in military uniforms who invaded the city in around 30 vans and on several motorcycles later withdrew from the city unchallenged.
?They moved out of the city on their own free will and are now in Dakin-Kowa town,? resident Bello Jatau said, referring to an area around 40 kilometres away.
He said fleeing residents of Dadin-Kowa were taking refuge on hilltops from where they could see Boko Haram gunmen burning their homes.
Soldiers were said to be patrolling the streets of Gombe and firing indiscriminately following the withdrawal of the insurgents.
?It is flying bullets everywhere. Soldiers are just firing anyhow. A bullet pieced the wall into my kitchen but luckily we were sheltering in the bedroom,? said a journalist in the city.
Gombe has been repeatedly hit by suicide attacks and other bombings blamed on the Islamists in the six-year insurgency in Nigeria?s northeast.
Two weeks ago, two suicide bombers blew themselves up outside a stadium, just minutes after President Goodluck Jonathan had left the venue where he had given a campaign speech. Many people were injured.
Locals said prior to Saturday?s invasion, the militants had camped at Hani village, 36 kilometres from Gombe, where they preached to locals and informed them they were on their way to take over the governor?s office in the city.
?They came around 6:00 am (0500 GMT) and took over the military checkpoint that was curiously abandoned by soldiers on Thursday,? resident Mustapha Baba told AFP.
? Ongoing offensive ?
He said the insurgents had fled from the Galda forest in neighbouring Yobe state following an offensive on their camps by Nigerian troops.
The Nigerian military last week launched a ground and aerial offensive on Boko Haram camps in the Galda forest, from where the Islamists are believed to be planning attacks in the area.
In the past few weeks, the group has stepped up its offensive both within Nigeria and against border towns of neighbouring countries, forcing the postponement of the general election.
On Friday, Boko Haram fighters attacked Chad for the first time, targeting a village on the shores of Lake Chad.
The attack marked a new escalation in the group?s bloody six-year campaign to establish a hardline Islamic caliphate in northeast Nigeria, which borders Cameroon, Chad and Niger. The conflict has killed some 13,000 people since 2009.
Nigeria, Cameroon, Chad and Niger this month launched an unprecedented joint effort to crush the extremists.