GARDEN GROVE, Calif. — Police on Thursday arrested a California man who allegedly robbed a liquor store to pay for court fees related to his previous criminal cases.

Ty Minhgat Phan, 23, was booked at the Orange County Jail on suspicion of armed robbery and other felony charges, according to the Garden Grove Police Department.

Just before midnight Wednesday, officers responded to a report of an armed robbery at K&M Liquor on Katella Avenue, the agency told KTLA.

A man with a semi-automatic handgun had just fled from the business after threatening an employee into giving him about $500 in cash, investigators learned. He was last seen walking southbound.

At 1:15 a.m., police were dispatched about 1 1/2 miles away due to a report of a man brandishing a handgun on Brookhurst Street and Chapman Avenue.

The man also allegedly threatened a clerk at the Luxor Restaurant on Brookhurst Street.

Responding officers found the suspect nearby with a loaded gun in his waistband and identified him as the perpetrator in the liqour store robbery, the Police Department said.

Phan, a convicted felon, said he committed the robbery to pay for court fines related to his other cases, according to police.