The Nigerian army has imposed a dusk-to-dawn curfew on the town of Maiduguri, capital of Borno state, following an attack by terror group Boko Haram (now Iswap).
Witnesses said militiamen armed with guns and rocket-propelled grenades attacked a military base in the town, clashing with the army before they withdrew.
"In view of the recent development within the metropolis, a 24-hour curfew is hereby imposed in the city," army spokesman Colonel Tanko Gusau was quoted by AFP as saying.
"This is done to protect lives and properties of innocent and law-abiding people of Maiduguri."
The army added that two female suicide bombers detonated explosives moments before the attack.
Hundreds of people fled following the attack and it is not yet clear whether anyone was injured or killed during the ambush.
AP quoted civilian defence fighter, Ibrahim Musa, as saying: "Many of them [Boko Haram] were killed outside the trenches while some fled back. We were with the soldiers during the attack and I was shocked to see that Boko Haram could be in such large numbers."
Maiduguri has often been raided by the insurgents. The latest attack, however, was the first after three months when Boko Haram killed more than 100 people in January.
Reports said the decline in the frequency of the attacks suggests that the group is suffering losses following a ground and aerial offensive by the Nigerian military as well as forces from neighbouring countries, which started in March.
In April, the army announced that it had entered what has been deemed as "the terrorists' last-known stronghold" in the Sambisa forest and freed nearly 700 people captured by the group. Boko Haram's tactic of kidnapping civilians caught global attention in April 2014 when the group kidnapped some 220 girls from Borno's Chibok village.
A vigilante who helps the Nigerian army in the fight against the insurgents alleged the latest Maiduguri attack could have been in retaliation for an ambush by the military on a terrorists' camp on 13 May. The vigilante, who asked not to be named, said that Boko Haram suffered huge casualties during the attack while women and children kidnapped by the militants were freed.
Borno is one of the states in northeastern Nigeria mostly affected by the terrorists' insurgence that has killed thousands of people since 2009.
The Nigerian army is being backed up by mercenaries and troops from Chad, Benin, Niger and Cameroon in its offensive, which was launched shortly before Nigerians re-elected former army leader Muhammadu Buhari, who vowed to halt the deadly insurgence in the country.