LAGOS, Nigeria — With music playing and food being passed around, a festive atmosphere hung over the protest encampment on Tuesday night, despite the anger over police brutality that in recent weeks had driven youthful demonstrations that were the biggest Nigeria had seen in a generation.
As darkness fell, Nigerian flags were handed out among the thousands of people gathered there. Philip Agu, a sound engineer who had volunteered to run the huge speaker system, said a protest leader took the microphone and told the crowd that the police would likely arrive soon, but that if they sat down, sang the national anthem and waved their flags, they would face no danger.
The speaker told the crowd, Mr. Agu recalled, that all around the world, “No soldier can shoot any citizen holding their own national flag.” Three hours later, dozens of people were hit by gunfire from security forces, some fatally, and images of bloodied protesters and their bloodied flags strewn on the ground flooded the social media accounts of millions of Nigerians.
Survivors recalled a sudden shift from sitting peacefully to fleeing in panic. Some said military and police units surrounded the demonstrators in the affluent suburb of Lekki, preventing them from leaving.
“I thought I was going to die,” said Kolade Abiola Ahmed, his voice still quaking a day later.
Soldiers and police officers opening fire on unarmed youths in an upscale neighborhood shocked the nation, even older citizens who recalled growing up under a series of military dictatorships. The protests over police brutality in the past two weeks had been larger and even more widespread than the last round of major demonstrations, in 2012, after the government stopped subsidizing fuel, but they had remained largely peaceful.
Nigeria’s security forces have long been criticized for human rights abuses, particularly in the impoverished northeastern region, but there was a different set of victims this time. Many of the demonstrators have been middle-class, well-educated young people in the southern and central cities, better off than earlier generations, and too young to remember military rule that ended in 1999.
Their movement, like Black Lives Matter in the United States, has been youth-driven, mostly leaderless and propelled by social media — a nimble, amorphous force that has been hard to quell.
On Tuesday, the security forces killed at least 12 people at demonstrations in the Lagos area, including 10 at Lekki, Amnesty International reported on Wednesday. “These shootings clearly amount to extrajudicial executions,” said Osai Ojigho, the group’s director for Nigeria. “There must be an immediate investigation and suspected perpetrators must be held accountable through fair trials.”
The government did not give casualty figures, but a police officer under the Lagos State Command Area Alpha headquarters, who was at the scene of the killings told The New York Times on Wednesday that at least 11 people had been killed.
On Wednesday, some of the protesters were out in the streets again, violating a 24-hour curfew imposed the day before, and newly aware that they could be risking their lives. Plumes of smoke rose from at least three buildings, including one that houses TVC News, which stopped broadcasting. Sporadic gunshots could be heard around Lekki and Yaba, districts 20 miles apart, separated by a lagoon.
Calling themselves the “Soro Soke” or “speak up” generation in the Yoruba language widely spoken in Lagos, the nation’s largest city, the protesters have insisted that a notorious police unit, the Special Anti-Robbery Squad, be disbanded, and its most brutal officers prosecuted. The unit, known as SARS, has earned a reputation for abusing, torturing and even killing young people; an Amnesty report in June referred to its “horrific reign of impunity.”
The demonstrators have “generally been from the middle classes, highly-educated Nigerians. And that’s why initially the police perception was the protests wouldn’t last because these are Nigerians that don’t know how to endure hardship,” said Murtala Abdullahi, a reporter with HumAngle, an online national publication.
The protests began after a widely seen and shared video appeared to show SARS officers killing a man, unprovoked. Officials said the video was fake and arrested the person who made it, making people still angrier.
Calls for action spread rapidly on social media, with the hashtag #EndSars, and celebrities in Nigeria and abroad — including Beyoncé and Justin Bieber — added their voices to the demands. Demonstrations grew in several cities, millions of people watched them unfold live online, and the grievances expanded to include chronic corruption and lack of accountability.
President Muhammadu Buhari — a former army general who led a military government in the 1980s — vowed last week to disband SARS. But there was no word on prosecutions, and government officials indicated that the officers would simply be moved to other units, not dismissed. Protesters denounced the changes as window-dressing.
On Tuesday, reports of police killing people, followed by the burning of a police station, prompted the governor of Lagos state, Babajide Sanwo-Olu, to declare a 24-hour curfew. He said that people bent on chaos had hijacked the peaceful protests.
Despite the curfew, the demonstrators near the Lekki tollgate did not disperse. Mr. Ahmed, who had been attending protests since Thursday, said people remained seated on the ground, chanting slogans and waving their flags, as at least a dozen trucks arrived with police and military units.
There were already ominous signs. Witnesses reported seeing people dismantle streetlights and remove security cameras that would have recorded what was to come next.
Many protesters contend that the government has used paid provocateurs to sow violence, as an excuse for a brutal crackdown.
The police officer who confirmed the deaths said that he and dozens of others were ordered to head to the Lekki protest at around 7 p.m. They piled into 15 Toyota pickup trucks, he said, joined by at least three Tata trucks full of soldiers.
Some demonstrators were armed, and others threw rocks at the uniformed forces, according to the officer, who spoke on condition of anonymity because he was not authorized to discuss the matter.
But other witnesses said that without warning or provocation, the security forces began shooting into the air, and then at the civilians trying to flee in terror.
“They were trying to circle us, put us in the middle, they were spreading out and they were trying to go around so that we would be in the middle,” said Eti-Inyene Akpan, a 26-year-old photographer who was there.
Many people, including Mr. Akpan and Mr. Ahmed, took shelter behind barricades and under parked cars. “There was a lady who excreted because of fear,” Mr. Ahmed said.
Video streams on social media showed wounded people lying in the streets, or being carried by others into teeming hospital emergency rooms.
The national government has been all but silent on what happened Tuesday night. Mr. Buhari appealed for calm.
In a televised statement on Wednesday, the governor, Mr. Sanwo-Olu, sought to distance himself from the security forces deployed on Tuesday, and said he had ordered an investigation into the “rules of engagement” they adopted.
“This is with the view to taking this up with the higher command of the Nigerian Army and to seek intervention of Mr. President” he added.
The curfew was extended by three days, until Saturday.
The bloodshed drew international condemnation, and not only from human rights groups. Joseph R. Biden Jr., the Democratic presidential candidate and former vice president, and Hillary Clinton, the former secretary of state, called on the authorities to halt the violent crackdown.
Despite the violent response, the protest movement will not go away, demonstrators and analysts said.
“The movement is succeeding while others have failed because of the format it adopted, both offline and online,” said Idayat Hassan, director of the Centre for Democracy and Development, a policy research group in Nigeria. “The hashtag has helped them to garner international support but importantly to galvanize the young people.”
For his part, Mr. Ahmed was back on the streets and protesting on Wednesday, fueled by anger at being shot. He and a small group first marched to the gates of a house belonging to the governor’s family.
“I was shouting his name to come out,” Mr. Ahmed said. “He doesn’t care even if I was killed or my friends were killed, too, and he says he is a leader.”
Shola Lawal reported from Lagos, and Monica Mark from Johannesburg.