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 approached them with the knife.
A large crowd was reported to have gathered at the scene.
No officers were injured in the incident.
Police and protesters clashed in the streets of Ferguson again late on Monday night, a day after the Governor of Missouri summoned the National Guard to help restore calm to the area where Mr Brown was shot dead.
An independent post-mortem examination determined that he was shot at least six times, including twice in the head, the family’s lawyers and hired pathologists said.
Witnesses have said his hands were above his head when he was repeatedly shot on August 9.
Protesters filled the streets after nightfall, and officers used bullhorns to order them to disperse. They deployed noisemakers and armoured vehicles to push demonstrators back. During one confrontation, officers fired tear gas and flash grenades. There were no reports of serious injuries but police said gunfire had been reported.