A Hartford man due in court to answer a charge of stealing a car apparently stole a car to get to court, police said.

Jonathan Rivera, 25, was at Superior Court in Hartford on Wednesday to answer a charge of first-degree larceny and tampering with a motor vehicle involving the theft of a car in Hartford on Feb. 17.

As he waited to appear before a judge, Hartford Parking Authority agents scanning license plates for parking violators got a hit on a white 2014 Subaru Legacy parked near the courthouse. The license plates had been reported stolen and the car itself had been stolen from Newington because a key fob was left in it, police said.