BOISE -- A man accused in an unprovoked attack on a 74-year-old who was raking his yard Thursday had been released from prison on parole in July, prosecutors say.

Ruben Diaz, 36, is charged with attempted murder for repeatedly stabbing and slashing the man outside the victim's Preamble Place home in southeast Boise.

Prosecutor Tamera Kelly said during a Friday arraignment that the Diaz approached the victim and spoke to him before the stabbing.

"[Diaz] asked the victim for directions, and right after that, started stabbing and slashing the victim's head and face multiple times," she said.

Horrified onlookers dialed 911. When police arrived, Diaz was still attacking the man, Kelly said.

Officers shot Diaz with a Taser after he refused to drop the knife, according to police. After he was taken into custody, prosecutors say, he told investigators he had planned to murder a person.

"He admitted to law enforcement that he had purchased the knife that morning for the sole purpose of trying to kill someone," Kelly said.

MORE: Boise Police tase stabbing suspect outside southeast Boise home

The 74-year-old was rushed to the hospital in serious condition. He remained hospitalized Friday afternoon.

The victim and Diaz did not appear to know each other before the attack.

Thursday's stabbing is not the first time Diaz has been accused of a violent crime.

He was convicted in Bonneville County in 2008 in two separate aggravated battery cases - both involving a deadly weapon - and sentenced to 30 years in prison.

But according to the Idaho Department of Correction, Diaz was paroled after serving just 10 years of that sentence. He was released July 2 - four months and five days before the stabbing.

Kelly urged the judge to set a high bond in the case.

"That's a lot of the state's concern - he's been in this community out of prison for very little time and has reoffended," she said.

Diaz spoke in a flat, monotone voice during Friday's hearing and repeatedly hunched forward, staring down or glancing sideways at his public defender.

Police have not released a motive in the case, but a judge seemed to indicate that mental illness played a role, ordering a mental assessment to determine whether Diaz is competent to stand trial. According to court records, attorneys in one of his previous cases had petitioned to have him held in a mental health facility until his trial.

Diaz' bond was ultimately set a $1 million. He was also barred from having any contact with the injured man.

A preliminary hearing is set for Nov. 15.