Nigeria's President Muhammadu Buhari has admitted that he has failed to end insecurity in the country, a promise he made when he was elected in 2015.
In a TV address, he said the fight against Islamist militants in the north had had the unintended consequence of spreading violence to other areas.
Buhari extended his "heartfelt condolences" to families of victims.
The Boko Haram Islamist group, which began its insurgency in 2009, has stepped up attacks in recent months.
After his election in 2015, President Buhari said the group had been "technically defeated" by an army offensive.
But there have been dozens of attacks in the north-east since the start of the year, and a number of military bases as well as towns have been overrun by the militants. Weapons, food and medicines have also been looted.
In his address marking Democracy Day on Saturday, President Buhari said the past two years had seen "challenges that would have destroyed other nations, especially relating to our collective security".
Referring to the attacks and kidnappings that have spread to north-west and central Nigeria, he said: "Unfortunately, like most conflict situations, some Nigerian criminals have taken advantage of a difficult situation".
He expressed his condolences to "families and friends of our countrymen, women and children who have been the unfortunate victims of such senseless kidnappings and murders".
The president said he would do "everything in [his] power to ensure security".
The speech came as some Nigerians gathered for nationwide protests over issues of insecurity.
In recent times, security forces have attacked protesters and many have accused the government of trying to prevent criticism.
Key protest organisers have often been targeted and arrested.
Over the past year the army has been withdrawing troops from smaller bases in the north-east to focus on large sites known as Super Camps.
However, it has left vast swathes of rural communities unprotected, analysts say.
There are concerns that armed criminal gangs in other parts of the country are forging links with the militants.
And last December, then army chief Lt Gen Yusuf Tukur Buratai suggested that the fight against Boko Haram could continue for another 20 years.