Nigeria's military has repelled a Boko Haram assault on the key city of Maiduguri as violence raged across the country's north-east just two weeks before national elections.
The hours-long attack on the strategic capital of Borno state was the Islamists' second attempt to take Maiduguri in a week.
As government forces were holding off Boko Haram in Maiduguri, the airforce of neighbouring Chad was pounding the militants' positions in Gamboru, a town on Nigeria's border with Cameroon 140 kilometers to the north-east.
With near-relentless violence plaguing much of the northeast, and Boko Haram still in control of large swathes of the region, fears are mounting over the prospect of organising polls on February 14.
The opposition All Progressives Congress (APC), which claims to be gaining momentum in the campaign against president Goodluck Jonathan, has rejected calls for the vote to be postponed.
But hundreds of thousands of voters in the north-east, an APC stronghold, could be disenfranchised by the unrest if the election goes ahead in two weeks.
Heavily-armed gunmen attacked the southern edge of Maiduguri at roughly 3:00 am (local time), setting off explosives as they tried to enter the city, several residents said.
Repelled in the south by troops backed by vigilantes, they regrouped and tried to take the city from the east, where they again met stiff resistance.
"The whole city is in fear," resident Adam Krenuwa said.
"People are afraid of what will happen if Boko Haram defeats the security forces."
Defence ministry spokesman Chris Olukolade said the assault on the town, where the extremist group was founded more than a decade ago, was "contained" and that "the terrorists incurred massive casualties".
"The situation is calm as mopping up operation in the affected area is ongoing," he wrote in a text message, a claim consistent with witness reports.
Despite being under fire in recent months, Maiduguri has become a place of refuge for people forced to flee other areas in Borno that have been taken over by the Islamist rebels.
In other attacks in the north-east on Sunday, a suicide bomber killed seven people in Potiskum, the economic capital of Yobe state, while two blasts killed five people in Gombe city to the south.
The bomber in Potiskum blew himself up shortly after midday outside the home of Sabo Garbu, who is running for a seat in the lower house of parliament on behalf of the ruling People's Democratic Party (PDP).
Seven people died in the blast and seven others were injured, a police officer at the scene who requested anonymity said in an account supported by three witnesses.
Mr Garbu and those attending his campaign meeting reportedly escaped unhurt.
It was not immediately clear if the attack was the work of Boko Haram.
Boko Haram, fighting to create a hardline Islamic state, has carried out dozens of bombings throughout its six-year uprising, which has claimed more than 13,000 lives.
Fearing the collapse of government control in areas controlled by the Islamists along their borders, Nigeria's neighbours have rallied to the fight against Boko Haram.
UN Secretary-General Ban Ki-moon on Saturday backed an African Union proposal for a 7,500-strong regional task force.
Chad has already sent troops and aircraft to help repel cross-border Boko Haram incursions.
Election officials have insisted Nigeria's vote will go ahead on February 14, but concede that voting will be impossible across much of the north-east.
Foreign observers have said that they will not even attempt to monitor polling in the region because of the unrest.
Mr Jonathan, who is facing a stiff challenge from former military ruler Muhammadu Buhari, has repeatedly tried to assure Nigerians that Boko Haram could be contained.
But those promises have consistently proved hollow, with the violence having escalated each year under his watch and his management of the crisis being fiercely criticised, including during the presidential campaign.
The APC's Buhari, a former army general who briefly led the country in the mid-1980s, has told voters that he will be able to curb the bloodshed but has so far not released a specific plan to deal with Boko Haram.