A Chicago man who fired a weapon inside a Megabus near Des Plaines in May 2015 was sentenced to prison Thursday.

Jacques Anderson, 29, pleaded guilty to armed violence in exchange for a 20-year sentence, according to court records. He also pleaded guilty to aggravated battery to a peace officer, for which he received a seven-year sentence. He will serve the sentences concurrently, with credit for 526 days in custody.

Anderson also must pay $714 in fines.

About 11:30 p.m. May 12, 2015, as the bus traveled west on I-90 en route to Minneapolis, Anderson entered the restroom and shot at the wall above the toilet. After leaving the restroom, authorities say, he became belligerent toward the driver. Another passenger noticed Anderson’s gun and wrestled him to the floor, where other passengers kept him subdued until the bus pulled into the Des Plaines oasis and police officers arrived.

After the Illinois State Police placed him in a squad car, Anderson kicked out a car window and fled. He got about 10 feet from the car when officers recaptured him.