Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Two St. Louis city police officers shot and killed a black man who came within several feet of them brandishing a knife on Tuesday a few miles from the turbulent suburb of Ferguson, authorities said.

A crowd of at least 100 people quickly gathered at the scene. Some people chanted, “Hands up! Don’t shoot!” — the refrain from a week of protests over the police killing of Michael Brown, an unarmed black teenager, three miles away.

Several hours after the shooting, there was tension in the air, but no physical confrontation. Police presence was limited, in stark contrast to scenes that unfolded in Ferguson last week.

"I think protest here will remain peaceful as long as the police keep a low profile," said Daniel Brown, 34, a St. Louis attorney.

The man in the St. Louis shooting had taken energy drinks and a package of pastries from a nearby convenience store, Police Chief Sam Dotson told reporters. He said that the man was “acting erratically, walking back and forth, up and down the street.”

The chief said that the officers repeatedly ordered the 23-year-old man to drop the knife and drew their weapons after he refused. The chief said the man told the police: “Shoot me now. Kill me now.”

He said the two officers fired after the man moved toward one of them and came within 3 to 4 feet.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

“One of the witnesses described it as a suicide by cop,” Dotson said.

Initially, there was a heavy police presence at the scene, and officers marked off the intersection with yellow tape. Antonio French, a St. Louis alderman who was arrested last week during protests over the Brown killing, urged the crowd to maintain peace.

“The last thing we need is violence in our neighborhood,” he said. “And that’s not going to be on the police to make sure there’s not violence in our neighborhood, that’s going to be on us. No silliness here.”

He said that he had much more confidence in St. Louis city police than in Ferguson police, and promised to work with the department to make sure there was not a “heavy-handed response” to any protests.

In Ferguson, protesters were confronted by a government “that quickly treated them like the enemy,” French told NBC affiliate KSDK.

“I think we have a different situation here, handled much better,” he said. “This is not Ferguson.”

The police shooting of Brown on Aug. 9 in Ferguson touched off more than a week of protests and clashes between police and demonstrators. Gov. Jay Nixon ordered the National Guard in on Monday to back up the state Highway Patrol and local police, and officials said the soldiers would be on patrol again Tuesday night.

Dotson said the tensions in Ferguson were on his mind.

“I think anyone who has been watching television over the last week has to be concerned. ... I think it’s important people understand what happened,” he said.

The chief stayed on the scene after the shooting, talking to people who gathered, some of whom angrily shouted questions at him. He said police were examining video and asking anyone else with video to come forward.

Four hours later, scores of people still milled about, some with signs and some chanting. A few predicted their numbers would grow at night.

"People have nothing to lose here," said Marvin Nelson, 40, a construction-firm owner. "It's going to be crowded tonight."

SOCIAL

Today @SLMPD officers received a call for a subject who appeared agitated & was armed with a knife. Suspect yelled kill me now & approached. — Chief Sam Dotson (@ChiefSLMPD) August 19, 2014

Officers gave suspect verbal commands. Officers feared for their safety and both officers fired their weapons. Suspect is deceased. — Chief Sam Dotson (@ChiefSLMPD) August 19, 2014

Officers are on administrative duty per department policy. The investigation continues. — Chief Sam Dotson (@ChiefSLMPD) August 19, 2014

— Gabe Gutierrez, Rick Brown, Erin McClam and Tracy Connor