Prominent Brisbane barrister Sam Di Carlo has been fined $4,000 for contempt of court over a heated exchange with Magistrate John Costello last year.

The Attorney-General applied for Mr Di Carlo to be punished after a complaint from the magistrate.

The complaint relates to a bail application last year, when Mr Di Carlo was representing a client and he told the magistrate: "You don't do things according to the law."

Mr Di Carlo came to prominence earlier this year after then Ipswich mayor, Paul Pisasale, was detained at Melbourne airport carrying $50,000 cash.

The barrister said he had asked Mr Pisasale to collect the money for him interstate on behalf of a client.

Mr Di Carlo's barrister told the Supreme Court his client had apologised for his rude behaviour and admitted he must better temper his emotions in court.

However he maintained Mr Di Carlo was a compassionate lawyer who sometimes allowed his passions to overflow.

In fining him, Chief Justice Catherine Holmes said his comments were "an affront to the court he represents".

She said she issued the fine as a deterrent to him and to others.

Outside the court, Mr Di Carlo said he believed the punishment was fair.

"I misbehaved on this occasion," he said.

"I crossed the line in my conduct, it was contemptuous. I conceded that.

"I have an honest belief that counsel shouldn't be deterred from being robust and indeed forceful where they perceive something to be unjust."

When asked if he was worried the fine would affect his reputation, he laughed.

"No, I'm not concerned. Many, many things have happened over my life ... and in this area I still have the respect of my clients and most of the people in the court system," he said.