Ottawa shooter Michael Zehaf-Bibeau attempted to confess to a historical armed robbery that the RCMP believed didn’t happen, then attempted an armed robbery at a McDonald’s to go to jail, court recordings provided to CTV News show.

It was all part of a bizarre plan by the man who attacked Parliament Hill to get to jail to atone for his sins and get clean from a crack addiction, the audio recordings show.

“Perfect, perfect,” a Zehaf-Bibeau says with a French accent on the tapes, when he is finally allowed to be incarcerated. “The RCMP are investigating.”

Zehaf-Bibeau visited the Burnaby detachment of the RCMP to claim he had committed an armed robbery in Quebec 10 years ago, but an officer could find no evidence of the crime. Instead, the RCMP arrested Zehaf Bibeau under the B.C.’s Mental Health Act, and released him the next day.

Zehaf-Bibeau then attempted to rob a Vancouver McDonald’s with a pointed stick, the recording reveals.

His grin unnerved the McDonald’s clerk, who asked if the man was serious. Zehaf-Bibeau said, “Yes, hand over the money, homeboy.”

The McDonald’s clerk refused, telling Zihaf-Bibeau that he had already phoned the police.

“Beat it,” the clerk said.

Zehaf-Bibeau walked out of the McDonald’s, and dropped his stick on the pavement to wait for police to arrive.

That’s when he was arrested and court workers concluded that he may have an undiagnosed mental health disorder, in addition to being addicted to crack.

At a Dec. 19, 2011 bail hearing, Zehaf-Bibeau told the court that he didn’t want to be on the outside.

“I wanted to come to jail,” he said. “The RCMP couldn’t do the work fast enough."

“I warned them that if you can’t keep me in I will do something right now to put me in.”

He was kept in jail pending his trial and given a psych assessment.

“The accused is aware of his charged and possible consequences of conviction,” said the psychiatrist. “He wants to be in jail as he believes this is the only way he can overcome his addiction to crack cocaine.”

“He has been a devoted Muslim for seven years and he believes he must spend time in jail as a sacrifice to pay for his mistakes in the past and he hopes to be a better man when he is eventually released."

"I am unable to find any features or signs of a mental illness and although he seems to be making an unusual choice this is insufficient basis for a diagnosis of a mental disorder. I recommend that the accused is presumed fit to stand trial,” the psychiatrist wrote.

On Feb. 22, 2012, Zehaf-Bibeau was sentenced to time served.

There is no record in that proceeding of a historical armed robbery, though Zehaf-Bibeau does have a criminal record in Quebec.