A man who pleaded guilty to stalking country music singer Shania Twain will undergo three weeks of psychiatric assessment.

Giovanni (John) Palumbo, a former Ottawa doctor, pleaded guilty to failing to comply with a court order and criminal harassment on Friday, two days into a trial that featured daily emotional outbursts in reaction to Twain's testimony.

Palumbo has been in custody in Toronto since March, when he was arrested for allegedly breaking a restraining order by attending the Juno Awards where Twain was joining the Canadian Music Hall of Fame.

Twain testified via video link during the trial, telling the court that Palumbo's sudden appearances outside her property, as well as love letters and personal gifts from him made her feel uncomfortable.

Palumbo changed his plea from not guilty to guilty midway through proceedings on Friday, claiming he had not realized Twain was afraid of him.

"He is devastated that she is afraid," his lawyer Gary Barnes told reporters outside court. "He never intended for her to fear at all. The absolute opposite; he loves her."

Palumbo had a restraining order issued against him for sending Twain a chain of fan letters, making a visit to her family's Muskoka cottage in 2009, and attending her grandmother's funeral.

Palumbo twice interrupted court proceedings this week, once to tell Twain he would plead guilty and once to defend the number of love letters he sent her.

Palumbo will return to court on Oct. 18. He may be sentenced depending on the results of the psychiatric evaluation.