Mohammed Umar, 22, from Bradford, was sentenced to two years imprisonment, suspended for two years, with a 40-day rehabilitation activity and a three-month curfew for breaking into a house and sniffing a woman’s underwear.

He had tried to break into the same house twice before and was sentenced to a community order by the city magistrates in February.

On March 21, a teenager babysitting at the house that Umar had broken into saw him holding a pair of women’s knickers to his nose while sitting in a woman’s bedroom.

The petrified teenager, who was on Facetime with a friend, recorded the incident on her phone.

He realised the girl had spotted him and walked calmly out the property.

Prosecutor Georgina Goring said that the teenager was left shaken and terrified after the incident.

Barrister defending Umar, Shufqat Khan, said a psychiatrist had been called to examine Umar’s sexuality and his clients mental health had recently deteriorated.

He also said that Umar received no medical help at the time he needed it most and if spared custody he would be under the care of a community psychiatric nurse if spared custody.

Judge Peter Hunt said it was “a sinister and bizarre” case.

He sentenced Umar to two years imprisonment which will be suspended for two years with a forty day rehabilitation activity and a three month curfew. A restraining order also bans him going to the house he burgled.

In closing Judge Hunt told Umar: “You have been treated very leniently. Don’t throw away this chance, and get yourself better.