Soulja Boy, the Atlanta-based rapper who brought us "Crank That," was sentenced to 240 days in jail on Tuesday, according to TMZ.

In court Tuesday, a Los Angeles judge told the rapper, whose real name is DeAndre Way, that he could have faced up to two years in state prison for violating his weapons probation earlier, but he opted to give Way some leniency, according to TMZ’s report. Soulja Boy will also have to serve 265 days of community service.

Soulja's probation stems from a 2014 arrest on charges of carrying a loaded gun in public, according to USA Today.

His probation was extended following a December 2016 arrest when police allegedly discovered Way was in possession of another firearm, according to the news site.

In February, police raided Way’s home to investigate a call about the rapper allegedly kidnapping and assaulting his ex-girlfriend. During the raid, police reportedly found ammunition in his home, which was a violation of his probation.

Soulja Boy was arrested in March for the parole violation as a result of the raid, according to People magazine. He has been serving time in jail for the charge since April 11.

Soulja Boy, 28, shot to fame in 2007 with his Billboard-charting record “Crank That.” He would go on to work with R&B stars like Trey Songz and Sammie. He releases other hits like “Pretty Boy Swag” and “Kiss Me Through the Phone.”