Coolio's airport gun bust is officially behind him -- a judge just released him from the rest of his probation sentence.

We got the "Gangsta's Paradise" rapper leaving court in L.A. County following a hearing in which the last year of his 3-year probation was waived in his gun case. It's unclear why the court cut him a break ... we've got a call in to the D.A.'s office.

NOT-SO-COOLIO
TMZ.com

We broke the story ... Coolio was arrested in 2016 at LAX after a loaded gun was found in one of his bags. He was charged with possession of a concealed weapon, and eventually pled guilty ... which resulted in a sentence of 3 years probation and community service.

There's a lesson in all this, and Coolio hilariously told us how he'd avoid a future "misunderstanding."

With his own troubles behind him, he offered Omarosa some advice regarding her White House recordings. It involves history and not biting the hand that feeds ya.