MAIDUGURI, Nigeria (Reuters) - Nigeria is replacing the military commander of the fight against Boko Haram after half a year, an army spokesman said on Wednesday, following a string of insurgency attacks despite years of official claims the group has almost been defeated.

The shake-up underscores the fragility of the security situation in Nigeria’s northeast, where the conflict with the Islamist insurgent group is now in its ninth year, despite assertions by President Muhammadu Buhari’s administration that it is on its last legs.

A military spokesman confirmed the replacement of Ibrahim Attahiru, theater commander of the operation against Boko Haram, in a text message to Reuters. Major General Rogers Nicholas will take his position.

The spokesman did not provide further details.

Attahiru’s removal comes in the wake of a series of “embarrassing” attacks, two military sources told Reuters. They said the conduct of the war against the insurgents is now being reviewed.

The attacks, which occurred during Attahiru’s command, include the kidnapping of members of an oil prospecting team which led to at least 37 people being killed in July, and deadly assaults on the towns of Magumeri, Biu and Madagali, the sources said.

A spokesman for the president, who serves as Nigeria’s commander-in-chief, declined to comment.

The governor of Borno state, which is at the epicenter of the insurgency, has said the government’s long-term plan now is to corral civilians inside fortified garrison towns - effectively ceding the countryside to Boko Haram.

That plan and the spate of deadly attacks have raised questions about assertions by the government and military that Boko Haram has been all but wiped out, as well as doubts about Nigeria’s ability to retain sovereign integrity in the northeast.