Updated

Soldiers killed scores of Islamic extremists in a rare victory as the insurgents advanced on a town near the northeast city of Maiduguri, an officer and other witnesses said.

One officer said a feared Boko Haram commander known only as Amir was among some 200 militants killed in a battle Friday in Konduga town, 22 miles from Maiduguri, the capital of Borno state and birthplace of the extremist group.

Also killed was a Boko Haram video journalist and a suicide bomber, he said.

There were no military casualties, according to the officer and a civilian self-defense group that fights alongside the soldiers. Both spoke on condition of anonymity because they are not authorized to speak to reporters.

Boko Haram in recent weeks has taken a string of towns stretching over 200 miles alongside Nigeria's northeast border with Cameroon in a new campaign to create an Islamic caliphate, mimicking the IS group in Syria and Iraq.

The extremists also have attacked a town and villages across the border in Cameroon, but that country's state radio said Cameroonian troops beat them off and forced them back across the border into Nigeria.

The United States said last week it is about to launch a major border security program for Nigeria and its neighbors, but gave no details.

Thousands of civilians have been forced from their homes in the latest offensive, joining more than 1.5 million other Nigerians who are refugees within their country or across borders in Niger, Cameroon and Chad, according to U.N. figures.

Extremists who have taken other towns have told residents that their next target is Maiduguri, the headquarters of the military campaign in the northeast. Boko Haram has attacked the city several times, with suicide and car bombs that have killed scores. In December they launched a bold attack on an air force base on the outskirts in which they destroyed five aircraft and in February an assault on the main military barracks in the city in which they freed hundreds of detainees.

The soldiers killed hundreds of unarmed detainees in the aftermath of that last attack, mostly civilians accused of belonging or supporting the insurgency. Amnesty International put the number of civilians killed by the soldiers at nearly 700.

Nigeria's military is accused of massive human rights abuses in the fight against the extremists, including the deaths of thousands of illegally detained people.

The United States has said it is launching a major border security project for Nigeria.