RICHMOND — The city's black mayor joined thousands of angry demonstrators Tuesday in a march from the state Capitol to the statue of Robert E. Lee on Monument Avenue, protesting police brutality against African Americans.

It was an act of contrition as much as solidarity, as Mayor Levar Stoney (D) apologized earlier in the day for officers firing tear gas at peaceful protesters Monday night without provocation.

Thousands swarmed Richmond City Hall at noon Tuesday after Stoney put the word out that he would apologize. That created a chaotic scene in which Stoney, surrounded by protesters yelling in his face, repeatedly tried to speak through a bullhorn but was shouted down.

Police Chief William Smith, conspicuous in his white-shirted uniform, stood behind Stoney as demonstrators called for his firing, called for him to release all prisoners, and generally vented frustration at what many called a colossal betrayal.

“People will be held accountable,” Stoney said to a chorus of obscenities and disbelief.

The gassing had taken place before the city’s 8 p.m. curfew as demonstrators stood at the foot of the Lee statue and after Stoney had encouraged them to come out in peaceful demonstration.

The police initially said they fired the tear gas to clear an exit for officers who felt threatened, but Smith later corrected that with a tweet saying the action was “unwarranted” and the officers involved would be disciplined.

On Tuesday afternoon, when Smith had a chance to address the crowd, he stepped forward and then knelt in a sign of solidarity. That brought a momentary ripple of applause. Finally, Stoney offered to join them in the march later — “if you’ll have me.”

For Jared Ivey, 19, the moment was a brief ray of hope after four days of exhausting demonstrations that have been accompanied by looting, dumpster fires, mass arrests and lots of tear gas. “It’s not that we hate police,” Ivey said, “we hate what police are doing to the people we love.”

The night before, Ivey had stood at the barricaded entrance to the Virginia Capitol, defying the governor’s curfew but preaching nonviolence. Thousands of demonstrators had converged there.

Some held barrel-size traffic pylons overhead, seemingly ready to charge the makeshift gates. Some had done that two nights earlier, tearing down metal fencing and pelting police with bottles before setting off on a looting and arson rampage across the city.

“This is about love. This is about love. That’s it,” Ivey, a former college student who works at Lowe’s, cried from behind a black mask, urging the crowd to refrain from violence while raising a fist in the air.

By the next day, authorities were trying to play up that message.

Gov. Ralph Northam (D), appearing in public for the first time since violence erupted, said at a Tuesday news briefing that he would not join the march, hinting that his presence could pose a security risk. But he pledged his support for addressing the root causes of the anger on the streets and rattled off a list of policy achievements and goals, including expanding Medicaid and funding programs to reduce maternal mortality among black women.

“I cannot know how it feels to be an African American person in this country right now or what you are going through,” said Northam, who was joined by several African Americans, including his longtime pastor. “I cannot know the depth of your pain. What I can do is stand with you and support you. And together, we’re going to turn this pain into action.”

At the Lee statue Tuesday night, Stoney was lost in the crowd of thousands. “Where is Stoney?” some chanted in a singsong taunt, thinking the mayor was a no-show. Then a man with a bullhorn announced that Stoney was there and asked whether they wanted to hear from him. The response was a mix of shouting that the mayor took as a yes, or a maybe. He stepped up to the foot of the monument and took the bullhorn.

He told the crowd that he would support a citizens review board for police. He said he had called the city prosecutor to urge her to drop charges filed against hundreds of protesters but cautioned that prosecution is not his call.

“She does not work for me. She works for y’all,” he said.

He joined in a “We want justice” chant. And a woman pointed her finger at him and said, “We will hold you accountable.”

As Stoney started to leave a little after 7 p.m., some booed him.

“I can’t stay past 8 o’clock,” he said. “You know that, right?

But some in the crowd of thousands seemed unaware of his presence. “Where is Stoney?” they continued to chant. Some of those up close shouted at him.

Stoney had linked arms along the way with Del. Lamont Bagby (D-Henrico), head of the Legislative Black Caucus. Other elected officials in the crowd included state Sens. Jennifer L. McClellan and Ghazala F. Hashmi, both Richmond Democrats.

Lt. Gov. Justin Fairfax (D) also appeared with marchers, saying he wanted to show solidarity after the “abhorrent” use of tear gas on peaceful protesters.

Virginia Lt. Gov. Justin Fairfax (D) joined protests in Richmond on June 2, one day after law enforcement used tear gas on peaceful protesters. (Greg Schneider)

On Monday night, there was no obvious violence or property destruction over eight hours of marching between Virginia Commonwealth University and the Capitol. A woman tried but failed to saw the leg off a bronze horse that is part of the monument to Confederate Gen. J.E.B. Stuart. Someone also strung a rope through the spur on Stuart’s boot in hopes of pulling the monument down — something police warned, via Twitter, could endanger the crowd below.

The night was not entirely peaceful, however. About an hour after the marchers disbanded, two police officers and a civilian were shot south of the James River. It was not immediately clear whether the incident was related to the protest. Police released few details.

But it was the tear-gassing incident that set the city on edge. About 15 minutes before the 8 p.m. curfew, Richmond police fired tear gas at a crowd that appeared to be peacefully protesting at the Lee statue. The volleys continued as the crowd scattered in all directions, some vomiting from the fumes as they fled.

Police issued a statement shortly after 8, saying that officers had been “cut off by violent protesters. The gas was necessary to get them to safety.”

But about 90 minutes later, the department tweeted that Smith had reviewed video and wanted to apologize for the actions of his officers.

“These RPD officers have been pulled from the field. They will be disciplined because their actions were outside department protocols and directions given,” the tweet said.

Stoney invited protesters who were gassed to come to City Hall at noon Tuesday. “I want to apologize in person,” he tweeted.

Virginia Attorney General Mark R. Herring (D) said Tuesday that the episode shows that police reform is “urgent and needed.”

Herring, who reviewed videos of the protest, added: “It looked to me like a nonviolent demonstration. It’s indicative of the need that many in law enforcement have to control people.”