The incident happened not far from Ferguson, which has seen days of protests over the fatal shooting of 18-year-old Michael Brown by a police officer.
Police Chief Sam Dotson said officers responded to an alert at a store where the man was reported to have stolen energy drinks and a pastry.
Mr Dotson says the man was acting erratically and told responding officers to “shoot me now, kill me now”. He says officers opened fire when the man began approaching them with the knife.
No officers were injured in yesterday’s incident. ~
US lawmakers called for calm and a change in police tactics in Ferguson, which has been rocked by racially charged clashes and riots after Brown, an unarmed black teenager, was shot dead by a white officer 10 days ago.
The violence has captured headlines around the world, raising questions about the state of US race relations.
Law enforcement has made various efforts to soothe angry demonstrators, but police said they had come under heavy gunfire on Monday night and arrested 31 people despite the deployment of Missouri National Guard troops and the lifting of a curfew to allow protesters more freedom to demonstrate.
“We overpoliced for a few days, and then we completely underpoliced,” US senator Claire McCaskill, a Missouri Democrat who was travelling to Ferguson yesterday, told MSNBC.
She said she was working with local leaders on ways to quell the violence.
Both she and US representative Emanuel Cleaver, another Missouri Democrat, said calm was needed to allow federal investigators to evaluate the evidence.
On Monday, Obama said he told Missouri governor Jay Nixon that use of the National Guard should be limited, and he also called for conciliation.
Attorney general Eric Holder plans to visit Ferguson today.
Brown was shot dead while walking with a friend down a residential street on the afternoon of August 9.
A grand jury could begin hearing evidence today to determine whether the officer, Darren Wilson, should be charged in the death, said Ed Magee, spokesman for St Louis County’s prosecuting attorney.
A third autopsy was performed on Monday for the Justice Department by one of the military’s most experienced medical examiners, attorney general Eric Holder said.
The Justice Department has mounted an unusually swift and aggressive response to Brown’s death, from the independent autopsy to dozens of FBI agents combing Ferguson for witnesses to the shooting.
Obama said the vast majority of protesters in Ferguson were peaceful, but warned a small minority was undermining justice.