A Hobart DJ who "cowardly" headbutted Tony Abbott out of contempt for the former prime minister 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 the afternoon of September 21.
Magistrate Michael Daly described the headbutt as unprovoked, opportunistic and cowardly deception.
The court heard Labe was drinking at a Hobart waterfront pub when he saw Mr Abbott walk past.
Labe followed the former prime minister and asked to shake his hand, before grabbing it and headbutting him, saying "you f***ing deserved it".
Mr Daly said Labe was motivated by contempt for Mr Abbott and it would be "very difficult" for any politician to refuse a handshake.
"Your opportunity to do harm to him was created by pretty cowardly deception," Mr Daly said.
"Causing an ideological opponent harm is not how differences are to be addressed in our society."
He said Labe had shown remorse for the attack but it was because of the "personal consequences" and not the offence.
"Any blow to the head is potentially serious," Mr Daly said, adding the punishment needed to be a deterrent to others.
Labe was sentenced to a maximum six-month jail term, although he will be eligible for parole after two months with the requirement he doesn't commit an offence for two years.
Mr Daly also ordered Labe to undergo drug and alcohol rehabilitation.
Tasmanian senator Eric Abetz described the sentence as appropriate.
"In our democratic polity, everyone should be treated with respect and without any physical threats, intimidation or attacks," he said in a statement.
Labe was initially charged with assault but pleaded guilty in January to the upgraded offence of causing harm to a commonwealth public official.
Mr Abbott said at the time he was left shocked and with a fat lip, claiming the attack was linked to the same-sex marriage debate.
Labe previously told media even though he was wearing a "yes" badge, the headbutt had nothing to do with marriage equality.
The attack drew international attention, including on Last Week Tonight with John Oliver.