CHICAGO -- An ex-con who spent most of his adult life in behind bars on Thursday got what he said he wanted for robbing a suburban Chicago bank. The 74-year-old gets to go back to the place he called home -- prison.

Telling Walter Unbehaun he frightened a teller by showing her a revolver tucked in his pants during the 2013 heist, a federal judge imposed a 3 1/2 year prison sentence, citing the man's lengthy rap sheet that includes crimes from home invasion to kidnapping.

"This is not the first time you've inspired fear," Judge Sharon Johnson Coleman said, repeatedly scolding the high-school dropout and part-time bathtub repairman.

As he had on the day he robbed the bank, Unbehaun gripped a cane as he hobbled to the podium to make a brief statement. He didn't withdraw his wish to go to prison, though he said, "I don't want to die in prison."

"My crime is bad, there ain't no doubt," he said in a strong voice. "I just wanna be like everybody else."

Boredom and loneliness, defence filings said, had partly led Unbehaun to conclude that a life on the inside was preferable to struggling to cope on the outside.

No family or friends of Unbehaun attended Thursday's hearing, and no letters of support were posted on his docket.

Listening to the proceedings, Unbehaun fidgeted and rubbed his forearms, both of which sported tattoos. He occasionally nodded as his lawyer spoke.

On Feb. 9 of last year, he walked into the bank with a cane but no disguise, displayed a loaded revolver in his waistband and told the teller, "I don't want to hurt you." With $4,178 in loot shoved in his pocket, he drove to a nearby motel and waited for police to arrive.

Confronted by authorities in the motel parking lot, the bald, portly Unbehaun dropped his cane, raised his hands and startled police by his apparent joy at getting nabbed.

At his initial court appearance, he also bewildered his appointed lawyer.

"His first words were, 'I just want to go home," that same attorney, Richard McLeese, told the court Thursday.

For a minutes, McLeese recalled, he thought Unbehaun was saying he hoped to get bond. Then, it dawned on him what Unbehaun meant.

"It is, without a doubt, one of the saddest and most disturbing cases I've dealt with," he said.

Lead prosecutor Sharon Fairley conceded the judge faced a dilemma: Sending Unbehaun to prison could be seen as more reward than punishment to him, but setting him free would risk him committing another serious crime.

Unbehaun's unusual case also raised broader societal questions, she said in one filing.

"Did the system fail Mr. Unbehaun? Or was his inability to stay out of jail the result of his own free will?" she asked. "We may never know. But what we do know, clearly, is Mr. Unbehaun lacks the desire to lead a law-abiding life outside of prison walls."

The Chicago-born Unbehaun first went to prison at 23 for transporting a stolen car. His record includes more than half a dozen convictions, including -- ironically -- escaping from prison.

Media accounts from 1970 describe how he kidnapped a 19-year-old girl and left her bound to an Ohio motel bed as fled in her car. For that, he was sentenced to 25 years. His most recent decade-long prison term, for bank robbery, ended in 2011.

Unbehaun pleaded guilty in September to the 2013 bank robbery in the Chicago suburb of Niles. Prosecutors had asked for a sentence of about seven years; the defence asked for three.

Unbehaun's third wife died while he was behind bars. Following his 2011 release, his sister and her husband bought Unbehaun, a childless widower, a trailer home in rural Rock Hill, South Carolina, the couple said Wednesday. Bored and alone, Unbehaun spent his days watching television or drawing and painting.

"He was living like a hermit," McLeese said. "The analogy he drew was that it was like living in solitary confinement."

McLeese told the court Thursday the onset of mild dementia may have contributed to his client's decision to rob his way back into prison. And he said the last judge who sentenced him had failed to ensure he had adequate mental health treatment.

Coleman said Unbehaun would also serve three years of closely monitored probation and that mental health services should be readily available to him.

As the hearing ended, Unbehaun requested he been sent to FCI Greenville prison in southern Illinois, walking her through the various benefits of the facility, including good work programs.

Coleman agreed to recommend that prison. She then shook her head.

"It's sad," she said, "to have a defendant who knows the facilities and knows which ones to go to."