A man from Hartford, Connecticut, was due in court to answer a stolen car charge.
But police said he drove another stolen car to get to court.
Outside the courtroom, Hartford Parking Authority agents were scanning license plates for any violations and found a hit on a white 2014 Subaru Legacy parked near the courthouse.
As Rivera was waiting to appear before a judge, the agents found the license plates had been reported stolen and that the car itself had also been stolen from Newington, due to a key fob being left inside.
Police then kept the car in their sights and waited for Rivera to leave the court.
The accused then entered the stolen vehicle and tried to drive off before authorities arrested him.
Rivera is now facing additional charges of second-degree larceny and taking a motor vehicle without the owner’s permission.
Meanwhile, on Wednesday, a 24-hour parking snow parking ban went into effect for Hartford.
During a snow parking ban, any on-street parking is prohibited in the city.
The ban lasted from 12 noon on Wednesday until noon on Thursday.