Nigeria's military has repelled a new attack by militant Islamist group Boko Haram on the strategically important north-eastern city of Maiduguri, an army source has told the BBC.
Dozens of militants and soldiers were reportedly killed during a major assault on the city on Sunday.
The city is quiet on Monday, with some businesses open, a BBC reporter says.
Earlier on Sunday, Boko Haram captured the north-eastern town of Monguno – the latest to be seized by the group.
It launched an insurgency in north-eastern Nigeria in 2009 to create an Islamic state.
US Secretary of State John Kerry arrived in Nigeria on Sunday to call for peaceful elections next month.
The vote looks set to be the closest since the end of military rule 15 years ago.
BBC Nigeria correspondent Will Ross says that Mr Kerry is in Nigeria to show solidarity in the fight against Boko Haram, which has increased its attacks in recent days.
Government troops beat back Boko Haram fighters after they launched an assault on Maiduguri on Sunday night – the second in less than 24 hours, an army source said.
Loud explosions were heard in the city, resident told the BBC Hausa service.
A 24-hour curfew was imposed on Sunday but this has since been relaxed.
The army in Monguno, 140km (85 miles) north of Maiduguri was reported to have been overwhelmed, with houses set on fire on Sunday.
A journalist in Maiduguri told the BBC that fleeing soldiers from Monguno had arrived at the barracks in Maiduguri.
Thousands of people have been killed in the insurgency, mostly in north-eastern Nigeria.
Mr Kerry (centre) held talks with President Jonathan (right) during a rare visit to Nigeria
Mr Kerry urged President Goodluck Jonathan and the main opposition's presidential candidate, former military ruler Muhammadu Buhari, not to condone violence during what is expected to be a tense election campaign,
"We are prepared to do more [to counter the Boko Haram threat] but our ability to do more will depend to some degree on the full measure of credibility, accountability, transparency and peacefulness of this election," Mr Kerry said, after talks with Mr Jonathan.
The US does not currently sell weapons to Nigeria's military because of its human rights record.
Our correspondent says that with the insurgents gaining ground, Maiduguri, the capital of Borno state, is increasingly at risk.
The city would be a major prize for Boko Haram, which last tried to take the city in December 2013.
President Jonathan visited the city on Saturday as part of his election campaign for the 14 February election.
It was his second visit in two weeks.
Earlier this month, he told some of the 5,000 refugees who had fled recent Boko Haram violence that they would soon be able to go back to their houses and that territory lost to the militants would soon be recaptured.