The protests began with calls for a much-hated police unit, the Special Anti-Robbery Squad (Sars), to be disbanded.
President Muhammadu Buhari did then dissolve the unit, which has been accused of illegal detentions, assaults and shootings, on 11 October.
But the demonstrators have called for more changes in the security forces as well as reforms to the way the country is run.
Lagos state Governor Babajide Sanwo-Olu has said that criminals have hijacked the protests “to unleash mayhem”.
He said he had “watched with shock how what began as a peaceful #EndSARS protest has degenerated into a monster that is threatening the wellbeing of our society”.
“Imposing this curfew was difficult, especially as we have just returned from a Covid-19 required lockdown,” he wrote on Twitter.
“This curfew will allow security officials to immediately restore order to the state, arrest thugs and miscreants that have disrupted the peace.”
The curfew was initially scheduled to come into force at 16:00 local time (15:00 GMT), but protesters in the Lekki and Alausa parts of Lagos refused to disperse.
They sang the national anthem at the Lekki toll gate – one of the main roads into Lagos’s business district.
As darkness fell, there were reports of shootings as security forces confronted hundreds of protesters.
Amnesty International Nigeria tweeted that it had “received credible but disturbing evidence of excessive use of force occasioning deaths of protesters at Lekki toll gate”.
The US consulate in Lagos announced it had closed on Tuesday and would remain shut on Wednesday.
Earlier, Nigeria’s chief of police Mohammed Adamu ordered the nationwide deployment of riot officers to try to end two weeks of increasingly violent protests.
Mr Adamu said in a statement that the Police Mobile Force (PMF) was needed “to protect lives and property of all Nigerians and secure critical national infrastructure across the country”.
He also ordered the massive deployment of police operatives to strengthen security around prisons.
The announcement of the curfew for Lagos state came after reports that people had set fire to a police station in the Orile district.
Videos posted on social media show the police station burning, with people standing outside cheering.
The police in Lagos said that “all security agencies have deployed adequate personnel to take charge and enforce the curfew across the state”.