A Hobart DJ who headbutted former prime minister Tony Abbott will spend at least two months behind bars.

Astro Labe, 38, was on Monday sentenced in Hobart Magistrates Court over the headline-drawing attack on Mr Abbott in September as he walked along the Hobart waterfront.

Magistrate Michael Daly described the attack as unprovoked and opportunistic.

He said Labe had shown remorse for the attack but it was because of the “personal consequences” and not the offence.

Labe was sentenced to a maximum six-month jail term, although he will be eligible for release after two months.

Camera Icon Astro Labe, 38, of North Hobart, is accused of assaulting former Prime Minister Tony Abbott. Credit: SAM ROSEWARNE

Labe had pleaded guilty in January to causing harm to a commonwealth public official.

The court previously heard Labe, had been drinking at a Salamanca Place pub when he saw Mr Abbott and an adviser walking past.

He followed Mr Abbott for about 250 metres and offered to shake his hand before “launching” into a headbutt.

“I just hate Tony Abbott. I can’t specify anything, crimes against humanity, yeah,” Labe said during a police interview after being arrested the next day.

Mr Abbott said at the time he was left shocked and with a fat lip and claimed the attack was linked to the same-sex marriage debate.

Camera Icon Astro Labe arrives at the Hobart Magistrates Court back in January. Credit: AAP/Rob Blakers

Labe previously told media even though he was wearing a “yes” badge, the headbutt had nothing to do with marriage equality.

Mr Daly also ordered Labe to undergo drug and alcohol rehabilitation.

- AAP