Boko Haram insurgents have attacked a military airbase in north-eastern Nigeria, destroying two helicopters, the authorities say.
Eyewitnesses say hundreds of militants attacked several areas of the city of Maiduguri, starting early on Monday.
A 24-hour curfew has been imposed in Maiduguri. Its civilian airport was also briefly closed.
A BBC correspondent says the large-scale, co-ordinated attack is a big setback for the Nigerian military.
Thousands of people have been killed since 2009, when Boko Haram launched its campaign to install Islamic law.
In May, a state of emergency was declared in Borno state, of which Maiduguri is the capital, as well as two neighbouring states, while there has been a massive military deployment to the worst-affected areas.
‘Crying and wailing’
Ministry of Defence spokesman Brig Gen Chris Olukolade said in a statement that two helicopters and three decommissioned military aircraft had been “incapacitated” during the attack which had been repelled.
He said some army bases had also been targeted, while 24 insurgents had been killed and two soldiers wounded.
Local residents told the AFP news agency that hundreds of heavily armed Islamist gunmen besieged the air force and army bases, razing buildings and setting shops and petrol stations ablaze.
“I saw two air force helicopters burnt,” a local official told AFP.
Bomb and gun attacks were carried out in Maiduguri, an AFP reporter in the city said.
A resident said: “We heard women and children in the barracks crying and wailing. At the gate, I saw some vehicles destroyed and the checkpoint there in shreds.”
There are reports of military checkpoints being attacked in different parts of the city.
Some eyewitnesses told the AP news agency they had seen bodies with their throats slit.
Others said several vehicles had been driven out of the air base carrying the bodies of victims.
Government and military officials said scores of people may be dead, AP reported.
A spokesman for the Nigerian civil aviation authority told the BBC that the airport had not been attacked, while Brig Gen Olukolade said flights had now resumed.
Recent Boko Haram attacks have been in more rural areas, and it had appeared as though the military operation had made Maiduguri city far safer, says the BBC Nigeria correspondent Will Ross.
Mobile phone links to the city have been cut since May, when the state of emergency was declared.
Boko Haram was founded in Maiduguri in 2002 and was also the scene of its first uprising, in 2009.
Get more stuff like this
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.