(CNN) -- The man suspected of robbing banks and killing a police officer was convicted of threatening President Barack Obama in 2010, the Secret Service said Sunday.
A nationwide manhunt for the suspected bank robber -- identified as 40-year-old Mario Edward Garnett by Phoenix police -- ended when a Phoenix police detective shot and killed a man after a new bank robbery on Saturday.
Secret Service spokesman Max Milien said that Garnett is the same individual arrested in 2010 in Oklahoma City for threatening the President.
Court records show Garnett pleaded guilty to those threats, was sentenced to eight months in federal prison and ordered to get mental health care upon his release.
He was not allowed to own a gun.
Garnett admitted that he wrote a rant on the official White House website that included this line: "If you order a strike on Iran, I'm going to come up there and blow your brains out on national TV," the documents said.
His prison term, including three years of supervised release, ended in July, records show.
Garnett's last heist took place Saturday morning in Phoenix. After leaving the bank with a bag and gun, Garnett was approached by a police officer and started shooting. The officer retreated, but an undercover detective was nearby and shot Garnett in the upper body, said Phoenix police spokesman James Holmes.
"This is a situation where we had a detective on the street doing a follow-up on an unrelated incident who heard a radio call. He was close by, so he responded." Holmes said.
Garnett was pronounced dead near the scene.
"It chills me to think what might have happened had he not responded, based on the information we have now," Holmes added.
Using cell phone records, the FBI confirmed that Garnett was in the area of two other holdups.
Garnett apparently started his crime spree across the country nearly a week ago when he tried to rob a bank Monday in Atlanta but failed and ended up robbing a customer at the bank's ATM.
Hours later, authorities believe, Garnett robbed a bank about 300 miles away in Tupelo, Mississippi. That robbery escalated to a gunfight with police, and two officers were shot.
One of those officers, Gale Stauffer, died. After hearing the news of Garnett's death, Stauffer's wife, Beth, said: "We can truly begin the healing process."
Tupelo Police Chief Bart Aguirre said Stauffer's death may be the first in the department's history.
The second officer shot, Joseph Maher, is recovering in a Tupelo hospital.
CNN's Alison Harding, Stephanie Goggans, Janet DiGiacomo, Scott Thompson and Adam Shivers contributed to this report.