HALIFAX -- A Halifax man was sentenced Monday to four years in prison for breaking into a home in a case that startled many residents of the city's south end.

Barry Edward Sinclair, 50, was given a five-year prison term but received credit for 12 months he has served in custody for break and enter -- a crime that infringed upon people's privacy, the judge said.

"Any time someone breaks into a dwelling when it is occupied is a very serious breach of personal integrity," said Judge Michael Wood of the Nova Scotia Supreme Court.

"We have many students living in apartments in south-end Halifax. They are entitled to be protected from strangers sneaking into their dwellings at night."

Crown attorney Denise Smith, who had sought a six-year prison term, said Wood's decision was fair.

"It's really, I would say, appropriately within the range for an offender with prior convictions for break and enter, and particularly as many as Mr. Sinclair had," Smith said outside court.

Earlier in the day, Smith told the court that Sinclair has 28 prior convictions, including 10 for break and enter, four for trespass by night and four for being unlawfully in a dwelling.

Defence lawyer Luke Craggs had argued for an 18-month prison sentence with credit for 12 months in custody, saying Sinclair's record shows improvement over the past decade, with fewer convictions and less serious crimes.

"That is certainly true, but there are convictions nonetheless," Wood replied, adding that his decision was "strongly influenced" by Sinclair's criminal record.

Wood said he took into account the fact there is no evidence of trauma from Sinclair's actions, but he did not agree with Craggs' assertion that it is "at the low end of the break and enter scale."

Michelle St. Amand-Johnson, a forensic and clinical psychologist at the East Coast Forensic Hospital, testified Monday on behalf of the Crown. She said she conducted a risk assessment of Sinclair and concluded he was a moderate-to-high risk to reoffend.

"I would suggest that impulse control for Mr. Sinclair is not great," St. Amand-Johnson said.

But while under cross-examination, she said her assessment of Sinclair was the first she has done without actually interviewing the subject.

Craggs declined comment after sentencing.

Sinclair, who sat silently during Monday's proceedings, was accused of breaking into two apartments and watching women sleep in the early hours of Sept. 15, 2011.

He was found guilty last November of breaking into one of the two homes after a woman living in a flat with several other people said she awoke when she heard a noise in her living room and saw a figure standing in her doorway.

The intruder left and a roommate came home to find the front door unlocked, which the residents said was unusual, the court heard. Wood said he was satisfied Sinclair had entered the home because his cellphone was found in a wash bucket in the property.

But Sinclair was found not guilty of illegally entering the other home and acquitted of five counts of voyeurism related to a video seized from his home of women undressing in their apartments.