Glendale Police Officer Joshua Hilling encountered the man walking down busy Interstate 75 in Ohio. The man said he didn't have identification - just a book bag with dirty clothes in it.
"I'm going to pat you down for officer safety," Hilling told Javier Pablo Aleman before putting the man against the back of the police car, authorities said.
Body camera footage shows what happened next: Aleman pulled out a knife and lunged toward Hilling, shouting, "I'm going to kill you!"
The officer shot Aleman once in the abdomen.
Aleman got back up and shouted "kill me!" more than 40 times at the officer, who exhorted Aleman to drop the knife and get down.
Officials in Ohio showed the 13-minute video of the incident during a news conference, where they announced that Hilling won't be charged in the March 29 shooting, the Associated Press reported.
Instead, Aleman will be charged with attempted murder.
"Joshua Hilling deserves a medal for what he did," Hamilton County Prosecutor Joe Deters said at the Tuesday news conference, WCPO reported.
Hilling "is one brave individual," Deters said. "He showed remarkable restraint involving the confrontation of an individual who was clearly armed."
Hilling didn't know it at the time, but Aleman, 46, was a fugitive wanted by police in Baltimore County, Md., for a homicide, according to the Hamilton County Sheriff's Office.
On March 17, Victor Adolfo Serrano was found dead after suffering multiple stab wounds, Baltimore County police spokesman John Wachter told the AP. Police have charged Aleman with murder in the death of Serrano, his former landlord.
The incident in Ohio comes at a time of increased attention on the use of force by police. A year-long Washington Post analysis showed that nearly a quarter of those shot and killed by police in 2015 were mentally ill or experiencing an emotional crisis.
Of the at least 247 people with mental health problems killed by police in 2015, 77 were explicitly suicidal.
The tense confrontation between Hilling and Aleman didn't end with a death. Other officers arrived at the scene and one fired a stun gun at Aleman, who dropped to the ground.
Before that, Hilling kept shouting at Aleman to "stay down."
"Drop the knife," Hilling shouted. "Get down."
He walked around and, repeatedly shouted "kill me," as Hilling backed away. At one point, the distraught man said: "Please, I'm begging you."
"After you see the video, you can only pray and wish that every police officer, every deputy sheriff in Hamilton County, was of [that] top quality," Hamilton County Sheriff Jim Neil said Tuesday.
Hamilton County was the location of another high-profile police shooting that attracted national attention. Last July, a University of Cincinnati police officer shot and killed an unarmed motorist. The officer was charged with murder.
Deters, the prosecutor, said his office had reviewed 100 police shootings; the fatal 2015 University of Cincinnati shooting was, he said, "the first time that we've thought, 'This is without question a murder.'"
On Tuesday, Deters said "there's a high probability" that the knife Aleman had during the tense run-in with Hilling was the same weapon used to kill Serrano in Dundalk, Md.
"We're awaiting further DNA tests from the evidence we've gotten," Deters said.
Prosecutors will present the attempted murder charge against Aleman before a grand jury in Ohio next week, Deters said.
Where to get help:
• Lifeline: 0800 543 354 (available 24/7)
• Suicide Crisis Helpline: 0508 828 865 (0508 TAUTOKO) (available 24/7)
• Youth services: (06) 3555 906 (Palmerston North and Levin)
• Youthline: 0800 376 633
• Kidsline: 0800 543 754 (available 24/7)
• Whatsup: 0800 942 8787 (1pm to 11pm)
• Depression helpline: 0800 111 757 (available 24/7)
• Samaritans: 0800 726 666 (available 24/7)
If it is an emergency and you feel like you or someone else is at risk, call 111.