DAKAR, Senegal — A major town in Nigeria’s troubled northeast has been taken over by Boko Haram in what local officials said was perhaps the Islamist militant sect’s most significant victory yet in a five-year campaign of violence and terror.

As many as 15,000 people, or nearly all of the residents, have fled the town of Damboa after it was attacked over the weekend, officials said, leaving behind dozens of bodies in the streets and the Islamists’ black flag flying overhead. Officials said at least 100 people were killed in the attack. Damboa is on a major north-south road from the Borno State capital, Maiduguri, and is just a few miles from Chibok, the village where hundreds of schoolgirls — who are still missing — were kidnapped in April.

Until recently, there had been a military post at the edge of Damboa, normally a bustling, muddy market town. But the Boko Haram fighters met with little resistance from Nigeria’s Army during the weekend assault, officials said.

“This is the first major town that has fallen to them, and it is located on a strategic road,” Gov. Kashim Shettima of Borno State said in a telephone interview from Maiduguri on Monday night. “It is a very major setback,” the governor said. The residents of Damboa “have all fled for now,” he said. “They have all fled.”