Boko Haram has launched a series of attacks in north-east Nigeria, hoisting its flags over several towns and overrunning a multinational military base.

Militants from Islamic State West Africa Province, a faction of Boko Haram that split off in 2016, have taken over the former commercial town of Baga near the border with Chad, and seized the nearby multinational joint taskforce base (MNJTF), in a show of force less than two months before Nigeria’s president, Muhammadu Buhari, seeks reelection.

Hundreds of people fled Baga for Maiduguri, the capital of Borno state, which has been the centre of the Boko Haram crisis during the past decade. Escapees said gunshots heralded the arrival of uniformed, turbaned men, who quickly took control of the town. Some said they led prayers in the town on Friday. The army chief of training and operations, however, said the fight was ongoing.

“We are having a ding-dong situation in Baga right now,” he said. “We are not in full control, but Boko Haram have not taken control either.”

Several communities surrounding Baga also fell to the insurgents, according to residents. “Boko Haram are now occupying the MNJTF and positioned their gun truck strategically in Shuwari town,” said Mala Musa, a youth volunteer living in Baga.

Hassan Mahmud, a resident of Kukawa, said they arrived just as he was starting dinner. “Boko Haram has taken over Cross Kauwa, Kukawa and Baga,” he said. “Presently Boko Haram (members) have hoisted their flag in Baga town and are in full control.

“I’d bet my life that Boko Haram are strongly and forcefully retaking the north of Borno state, because they easily sweep the area. No soldiers are in these areas as I speak, and most of our civilian populace have run out of the town.”

Facebook Twitter Pinterest President Muhammadu Buhari, who is seeking reelection. Photograph: Sunday Alamba/AP

Mahmud managed to flee Kukawa, taking most of his family members with him. Arriving into Maiduguri at 9am on Friday morning, he sipped some tea as he recounted the ordeal that led to their 200km journey.

He said the militants headed straight for the military bases, trying to reassure civilians that they would be safe. “Boko Haram were even telling us: ‘Don’t worry, we are not here for you. Stay where you are and don’t panic.’ But can we trust them? Definitely not.”

Baga, previously a bustling town home to 300,000 people, was the site of what Buhari, then in opposition, called “an unspeakable massacre” in 2015. Up to 2,000 people are thought to have died then, but, as one resident said: “No one stayed back to count the bodies.”

Over 100 police officers who were being trained in counter-terrorism were sacked this week after they absconded to avoid having to fight Boko Haram, Nigerian media has reported.

Nigerian soldiers frequently complain of being poorly equipped to fight a group that has killed tens of thousands of people, raped and kidnapped many more, and displaced millions.

“The morale of our military personnel is going lower every day because our strength is daily weakened by the number of casualties.. due to lack of or obsolete equipment,” said an officer who asked for anonymity.

Buhari’s campaign for a second term rests partly on his security record – last week he claimed that “people in the north-east know that we have recorded remarkable improvement in the fight against Boko Haram”.

His administration has sent thousands of displaced people back to the areas they fled to try to further this perception, despite the fact that many of them remain unsafe. The spate of attacks over Christmas could undo this carefully crafted perception.