A man who dodged a jail sentence over a "horrific" attack on his girlfriend has been branded "stupid" by a sheriff after he was caught smoking cannabis while doing his community service.

Serial domestic abuser Darren McMenemy had faced a lengthy jail term after shoved Mary Reid over in a lift before kneeing her in the head.

But instead McMenemy, who has three separate convictions for attacking Miss Reid during their three-year relationship, was given a community payback order with 200 hours unpaid work and supervision.

However, McMenemy was back in court on Wednesday after being caught taking class B cannabis while on the unpaid work order.

A sheriff branded McMenemy's behaviour as "amongst the most stupid" he had ever come across.

Dundee Sheriff Court was told that McMenemy, of Tulloch Court, had completed 72 hours of the order at the time.

George Donnelly, defending, said the incident had been a "blip" and asked for further time for his client to complete the unpaid work.

McMenemy, 32, admitted committing a breach of a community payback order on November 18.

Sheriff Alastair Brown told McMenemy: "This court hears about a variety of stupid behaviour. Taking controlled drugs while you are there to do unpaid work ranks amongst the most stupid.

"This is an alternative to imprisonment. Its an alternative to up to five years in prison. You were given a chance, stop messing about and take it.

"If you breach again you can expect to spend considerable time in Perth Prison."

McMenemy was given until April 14 to complete the unpaid work, when he will return for a review hearing.

McMenemy's attack was captured in full on CCTV in a horrifying video, which was shown at Dundee Sheriff Court, where McMenemy broke down in tears as it was played.

But despite the brutal nature of the attack, and his record of previous attacks, McMenemy avoided a jail term.

The video showed the pair returning to the block of flats, with blood pouring from McMenemy's left eye from a previous, unknown incident.

They then get into a lift where McMenemy suddenly shoves Miss Reid to the ground.

He then begins repeatedly punching her on the head before the lift stops at a floor and the door opens.

He is then seen repeatedly stepping back out through the door and running up to Miss Reid before thrusting his knee into her face and body.

McMenemy breaks off from the attack to hurl abuse at her before delivering a final blow with the knee.

Miss Reid then gets up and runs out of the lift.

Fiscal depute Nicola Gillespie told the court: "The incident took place around 1.10am and was witnessed on the CCTV by the concierge at another block of flats, who contacted police.

"Several units attended and Miss Reid was found trying to get away from the accused, who was detained."

McMenemy pleaded guilty on indictment to a charge of assaulting Mary Reid on April 11, 2015 at Tulloch Court, Dundee.

Defence solicitor George Donnelly said: "He saw the CCTV footage and for the first time he has seen him perpetrating an offence on his partner.

"In his own words he said he was filled with disgust. However, he is trying to embark upon a change in his whole outlook to his partner and society in general.

"Perhaps by the grace of God rather than anything else there was no injury to this lady."