Rapper DMX played his own song to a judge in court

Image source, Getty Images

Rapper DMX played one of his own songs to a judge in court, managing to avoid the maximum sentence for tax fraud in the process.

The US rapper was in court for dodging $1.7m (拢1.2m) in taxes and could have been given up to five years in prison.

After listening to the song, the judge said DMX was a "good man" and gave him one year in prison.

He was also ordered to pay $2.3m (拢1.6m) to the tax authorities.

Image source, Getty Images

Image caption, DMX with his lawyer outside court last year

The rapper's lawyer said that the significance of the song Slippin' was that it shows how DMX's difficult upbringing meaning he wasn't prepared for the responsibility of having lots of money.

"See, to live is to suffer/But to survive/Well, that's to find meaning in the suffering," he raps in the 1998 track.

Prosecutors had said that DMX paid royalty cheques into the bank accounts of other people to avoid paying tax.

He pleaded guilty to one charge back in November.

Image source, Getty Images

Image caption, DMX in the film Romeo Must Die

Real name Earl Simmons, the father-of-15 has spoken previously of being a devout Christian.

He has served jail sentences in the past on charges including animal cruelty, reckless driving, drug possession and weapons possession.

DMX has also appeared in films including Cradle 2 the Grave and Romeo Must Die, both starring Jet Li.

He also featured alongside Jay-Z on Ja Rule track It's Murda from 1999.

Follow Newsbeat on , and .

Listen to Newsbeat live at 12:45 and 17:45 every weekday on 大象传媒 Radio 1 and 1Xtra - if you miss us you can listen back here.