BALTIMORE — Baltimore was a city on edge Tuesday night as hundreds of National Guardsmen patrolled the streets, hoping to prevent another outbreak of rioting.

Maryland’s governor said 2,000 Guardsmen and 1,000 law officers would be stationed overnight to try to head off a repeat of the racially charged violence set off Monday by the case of Freddie Gray, a 25-year-old black man who died of a spinal-cord injury under mysterious circumstances while in police custody.

“This combined force will not tolerate violence or looting,” Gov. Larry Hogan warned.

Baltimore was under a citywide 10 p.m.-to-5 a.m. emergency curfew. All public schools were closed. And the Baltimore Orioles canceled Tuesday night’s game at Camden Yards and announced that Wednesday’s game will be closed to the public.

The streets were largely calm all day and into the evening, with only a few scattered arrests. The real test came after dark, when police enforced the 10 p.m. curfew.

Several hundred protesters remained in the street in the city’s Penn North section, near where a CVS pharmacy was looted. Standing shoulder to shoulder, police in helmets and riot shields began advancing toward the demonstrators in an effort to push them back. Some protesters lay in the street or hurled bottles toward the police.

As the hour drew near, a local pastor used a loudspeaker to urge the demonstrators to go home, saying: “Let’s show the world, because the eyes of the world are on Baltimore right now.”

Around the same time in a different neighborhood, Baltimore police tweeted that they were making arrests in South Baltimore after people started attacking officers with rocks and bricks. At least one officer was reported injured.

Monday’s looting, arson and rock- and bottle-throwing by mostly black rioters broke out just hours after Gray’s funeral. It was the worst such violence in the U.S. since the unrest that erupted last year over the death of Michael Brown, the unarmed black 18-year-old shot by a white police officer in Ferguson, Missouri.

Political leaders and residents called the violence a tragedy for the city and lamented the damage done by the rioters to their own neighborhoods.

“I had officers come up to me and say, ‘I was born and raised in this city. This makes me cry,”‘ Baltimore Police Commissioner Anthony Batts said.

Haywood McMorris, manager of the wrecked CVS store, said the destruction didn’t make sense: “We work here, man. This is where we stand, and this is where people actually make a living.”

But the rioting also brought out a sense of civic pride and responsibility in many Baltimore residents, with hundreds of volunteers turning out to sweep the streets of glass and other debris with brooms and trash bags donated by hardware stores.

Blanca Tapahuasco brought her three sons, ages 2 to 8, from another part of the city to help clean up the brick-and-pavement courtyard outside the looted CVS.

“We’re helping the neighborhood build back up,” she said. “This is an encouragement to them to know the rest of the city is not just looking on and wondering what to do.”

The crisis marks the first time the National Guard has been called out to deal with unrest in Baltimore since 1968, when some of the same neighborhoods that rose up this week burned for days after the assassination of the Rev. Martin Luther King Jr. At least six people died then, and some neighborhoods still bear the scars.

Jascy Jones of Baltimore said the sight of National Guardsmen on the street gave her a “very eerie feeling.”

“It brought a tear to my eye. Seeing it doesn’t feel like the city that I love,” she said. “I am glad they’re here, but it’s hard to watch.”

At the White House, President Obama called the deaths of several black men around the country at the hands of police “a slow-rolling crisis.” But he added that there is “no excuse” for the violence in Baltimore, and said the rioters should be treated as criminals.

“They aren’t protesting. They aren’t making a statement. They’re stealing,” Obama said.

The rioting started in West Baltimore on Monday afternoon and by midnight had spread to East Baltimore and neighborhoods close to downtown and near the baseball stadium.

At least 20 officers were hurt, one person was critically injured in a fire, more than 200 adults and 34 juveniles were arrested, and nearly 150 cars were burned, police said. The governor had no immediate estimate of the damage.

With the city bracing for more trouble, several colleges closed early Tuesday, including Loyola University Maryland, Johns Hopkins University and Towson University.

The violence set off soul-searching among community leaders and others, with some suggesting the uprising was about more than race or the police department – it was about high unemployment, high crime, poor housing, broken-down schools and lack of opportunity in Baltimore’s inner-city neighborhoods.

The city of 622,000 is 63 percent black. The mayor, state’s attorney, police chief and City Council president are black, as is 48 percent of the police force.

“You look around and see unemployment. Filling out job applications and being turned down because of where you live and your demographic. It’s so much bigger than the police department,” said Robert Stokes, 36, holding a broom and a dustpan on a corner where some of the looting and vandalism took place.

He added: “This place is a powder keg waiting to explode.”

In the aftermath of the riots, state and local authorities found themselves facing questions about whether they let things spin out of control.

Batts, the police commissioner, said police did not move in faster because those involved in the early stages were just “kids” – teenagers who had just been let out of school.

“Do you want people using force on 14- 15- and 16-year-old kids that are out there?” he asked. “They’re old enough to know better. But they’re still kids. And so we had to take that into account while we were out there.”

Mayor Stephanie Rawlings-Blake waited hours to ask the governor to declare a state of emergency, and the governor hinted she should have come to him earlier.

“We were trying to get in touch with the mayor for quite some time,” Hogan said. “She finally made that call, and we immediately took action.”

Rawlings-Blake said officials initially thought they had the unrest under control.

Gray was arrested April 12 after running away at the sight of police, authorities said. He was held down, handcuffed and loaded into a police van. Leg cuffs were put on him when he became irate inside. He died a week later.

Authorities said they are still investigating how and when he suffered the spinal injury – during the arrest or while he was in the van, where authorities say he was riding without being belted in, a violation of department policy.

Six officers have been suspended with pay in the meantime.