President Muhammadu Buhari made the comments in a statement released late on Friday.
His assertion that security forces have used "extreme restraint" is likely to further inflame tensions after Amnesty International reported that soldiers shot and killed at least 12 demonstrators on Tuesday night as a large crowd sang the national anthem.
Mr Buhari said 11 policemen and seven soldiers had been killed by “rioters” as of Thursday, and “the mayhem has not stopped”. He added that another 37 civilians were injured
The president was speaking to a special meeting with former heads of state and other officials on the way forward after some of Nigeria’s worst turmoil in years.
The country has been gripped by unrest after two weeks of mounting protests which have prompted international outrage.
The street demonstrations began early this month with calls for Nigeria’s government to shut down the Special Anti-Robbery Squad, a police unit known as Sars.
The squad was launched to fight crime, but it carried out torture and killings, according to Amnesty International.
The #EndSARS campaign spread across the country and Buhari’s government announced that it would disband the Sars unit.
The protest persisted with demonstrators calling for more widespread reforms of the police and an end to corruption.
Violent unrest erupted on Wednesday in Lagos as mobs vandalised and burned police stations, courthouses, TV stations and a hotel.
Smoke billowed from several locations in the city as police battled angry crowds with tear gas and gunfire.
Additional reporting by Associated Press.