Boko Haram militants have seized the north-eastern Nigerian town of Chibok, from where they kidnapped more than 200 schoolgirls in April.
Militants attacked and took control of the town, in Borno state, on Thursday evening, residents who escaped told the BBC.
Boko Haram has repeatedly targeted villages around Chibok over recent months.
The group says it is fighting to create an Islamic state in Nigeria.
The schoolgirl kidnappings in Chibok caused worldwide outrage and sparked a social media campaign.
Separately on Friday, a suicide attack at a petrol station in the northern city of Kano left at least six people dead, police said.
A senator for Borno state, Ali Ndume, told the BBC Hausa service that security forces posted in Chibok, a relatively small, mainly Christian town, ran away when the insurgents attacked.
Residents told the Sahara Reporters news website that the militants headed to the centre of Chibok and declared that they were taking it over as part of their caliphate.
Musa Ali, a vigilante who tried to defend Chibok, said the militants had attacked in two groups.
“You couldn’t count them because there were so many,” he said.
“All the security and the soldiers, they ran away and left us on our own. They didn’t shoot at them, they just ran. All the ammunition we had was finished, so there was no way we could attempt to hold the area.”
Since the kidnapping of the girls, people have complained that the area was not well protected and many residents of Chibok had already moved to safer parts of the country, fearing another attack.
The BBC’s Will Ross in Nigeria says the military has repeatedly failed to defend towns and villages in the north-east, allowing Boko Haram to steadily expand the area it controls.
The crisis in Nigeria is deepening every week, but politicians appear more focused on next year’s elections, our correspondent says.
Emman Usman Shehu, an activist with the Bring Back Our Girls campaign, said the authorities should have realised that Chibok would be a symbolic target for the insurgents.
“It should have been obvious to everyone that Boko Haram was going to target Chibok. It shows a lack of compassion, a lack of empathy and a lack of concern,” he told AFP news agency.
Boko Haram has changed tactics in recent months by holding on to territory rather than using hit-and-run attacks that have left thousands dead.
Last month, the group dismissed the government’s claims to have agreed a ceasefire. The government had said the ceasefire would set the stage for the release of the Chibok schoolgirls.
Chibok’s seizure comes a day after a government helicopter came down in Yola, in north-east Adamawa State – the second military helicopter to go down in the area in a week.
Also on Thursday, officials and residents said the army had managed to recapture the town of Mubi, which was the biggest town under Boko Haram’s control.