DAMATURU/MAIDUGURI, Nigeria (REUTERS) - Boko Haram gunmen attacked a Nigerian military base and adjacent police barracks simultaneously in the northeastern town of Buni Yadi, killing at least 31 security personnel, security sources and witnesses said.
The attack late on Monday in Yobe state occurred not far from where the Islamist insurgents shot or burned to death 59 pupils at a boarding school in February.
The militants, whose violent struggle for an Islamic state in northern Nigeria has killed thousands and made them the biggest threat to security in Africa's top oil-producing state, are still holding more than 200 girls kidnapped on April 14, an act which provoked a storm of international outrage.
A witness and resident of Buni Yadi, who identified himself only as Mustafa for fear of retribution, said the militants arrived in an armoured personnel carrier and six Toyota Hilux pickup trucks before dismounting and firing into the air.
They fired rocket propelled grenades at both bases.
A senior security source in Yobe state said 17 soldiers were confirmed killed and 14 police officers, including a female police officer, also died.
The spokesman for defence headquarters was not immediately available for comment, but a military source at the headquarters of the northeast operation in Maiduguri confirmed the attack. Yobe police spokesman Nansak Chegwam said he knew of it but that the details were sketchy.
In what has become rare for a movement that has killed thousands of civilians in the past year, Boko Harm called out to people on the street not to run away as they had only come for the security forces, Mustafa and the Yobe police source said.
The insurgents also razed the police barracks, the army base, the high court and residence of district head Abba Hassan. "One was shouting in English to the others: 'Let's go, let's go. Finish this and let's go'," a policeman who escaped the attack and fled to the state capital Damturu said.
From being a clerical movement opposed to Western culture - Boko Haram means "Western education is a sin" in the northern Hausa language - the sect has emerged as well armed, fully fledged armed insurrection.
A military offensive launched a year ago to try to flush Boko Haram out, which initially seemed to be working, appears to have left them stronger than ever. The insurgents occupy a vast, hilly terrain along the Cameroon border, from where they have repeatedly launched devastating hit and run strikes.
Cameroon has deployed some 1,000 troops and armoured vehicles to its border region with Nigeria as it steps up its military presence to counter the rising threat.
Nigeria and its neighbours say Boko Haram now threatens the security of the whole region.
Chief of Defence Staff Air Marshal Alex Badeh said on Tuesday the military knew where the abducted girls were but ruled out using force to rescue them for fear of endangering their lives.
Since the girls were captured, according to a Reuters count, at least 470 civilians have been killed in various locations at the hands of Boko Haram, which has said it wants to reinstate a medieval Islamic caliphate in Africa's most populous nation.
Nigeria accepted help from the United States, Britain, France and China last week and around 80 U.S. troops have started arriving in neighbouring Chad to start a mission to try to free the girls. Surveillance drones are scanning the Sambisa forest, where parents say the girls were last sighted.