An Australian prisoner who beat to death a mob boss with a pole and then dragged his body back to his cell was sentenced to 32 years in jail on Thursday, with the judge condemning the man's prison code belief that he had a right to kill.

Mobster Carl Baby Face Williams was serving four life sentences for murder during a gangland war in Australia's second largest city Melbourne, but had turned informant in jail.

Prisoner Matthew Johnson said he killed Williams in 2010 in self-defence, but a jail camera showed Johnson approached Williams from behind and beat him over the head with a pole from a prison exercise bike.

Williams, who was reading a story about himself in a newspaper at the time of the attack, was then dragged back to his cell.

In passing sentence, Victorian Supreme Court Judge Lex Lasry said Johnson was the General of a prison gang called the Prisoners of War who hated anyone assisting police, local media reported.

During Johnson's trial in September, the court heard Williams bragged to fellow prisoners of his involvement in at least 15 murders, three of which he said he had committed.

It was a killing which appears to demonstrate your belief that you have some special entitlement to kill when you think it appropriate or your ego demands it according to some meaningless underworld prison code, said Lasry.

I am left with no choice but to punish what you have done with an appropriately heavy sentence, he said, ordering a 32 year sentence without parole.

(Reporting by Michael Perry; Editing by Yoko Nishikawa)