Shania Twain, seen here in 2008, testified via video link during Palumbo's trial. ((Peter Kramer/AP))

The former Ottawa doctor who admitted to stalking singer Shania Twain has been released with credit for time served.

In September, Giovanni (John) Palumbo pleaded guilty to criminal harassment by watching and besetting, and one count of failure to comply with a court order.

He had been in custody since being arrested in March.

Palumbo was sentenced to three years of probation and is not allowed within a half kilometre of Twain, her family or any of her professional staff.

He's also not allowed to contact her or communicate with her, directly or indirectly.

Dr. Helen Ward told court on Tuesday that Palumbo suffers from bipolar disorder and a narcissistic personality disorder and shows obsessive-compulsive traits.

Ward was presenting a psychiatric evaluation that had been requested by Crown lawyer John Flaherty ahead of sentencing.

During Palumbo's trial, Twain testified via video link and described the numerous lovelorn letters Palumbo had mailed to her and discussed her discomfort with his unwanted visits to her family cottage, her grandmother's funeral and the Juno Awards, where he was arrested.

Palumbo has been a volatile presence throughout the trial, and had several more outbursts during his latest court appearance.

When Ward described his narcissistic traits, Palumbo shouted: "I'm not narcissistic, I agree you're all superior to me."

Earlier, during testimony from the police officer who arrested him, Palumbo again couldn't resist interrupting.

"I am innocent. I have never harmed anyone or anything in my entire life and I don't intend to harm anyone or anything in my entire life," he said.