The St. Anthony police officer who fatally shot Philando Castile earlier this month helped book Castile into jail after a 2011 traffic stop that started with a defective brake light, newly released records show.

Officer Jeronimo Yanez was also one of the two officers assigned to work the July 2 armed robbery of a Lauderdale convenience store — scanner audio and Yanez’s attorney said he pulled over Castile’s white Oldsmobile the night he was killed because he matched the description of a suspect from a previous robbery.

The new details are contained in records that the city of St. Anthony released late Thursday in response to media requests.

The 2011 traffic stop, in which Castile was arrested and cited for driving with a revoked license, was the only previous incident the city of St. Anthony had recorded with Castile before he was killed July 6, according to City Attorney Jay Lindgren.

Castile was driving a Chevrolet south on Hamline Avenue near Larpenteur Avenue in Falcon Heights on Nov. 23, 2011, when officer Mark Dokken pulled him over for a defective brake light, according to the incident report. Dokken then discovered Castile had a revoked license and an outstanding misdemeanor warrant in Hennepin County for driving after revocation.

Yanez was one of the two officers who took Castile to the Hennepin County jail for booking.

More than four years later, on July 2, 2016, Yanez and another officer were assigned to the armed robbery of a convenience store in Lauderdale. Employees of the Super USA at 2424 Larpenteur Av. W. near Hwy. 280 described the suspects and said they had taken $700 in cash and cigarettes, the incident report said.

Officers cleared the scene around 10 o’clock that night. Officer Tressa Sunde, and not Yanez, is listed at the primary officer on the case.

The heavily redacted report provides few other details.

Four days later, Castile was cruising down Larpenteur Avenue near the State Fairgrounds in his white Oldsmobile when St. Anthony police officers pulled him over, thinking he matched the description of the robbery suspects.

What led Yanez to shoot Castile several times through the driver’s window hasn’t been made public. Castile’s girlfriend, Diamond Reynolds, famously documented Castile’s final moments with her cellphone, showing him slumped over in the driver’s seat bleeding heavily before losing consciousness. He died that night.

Castile’s death touched off weeks of emotional protests and remains under investigation by the Minnesota Bureau of Criminal Apprehension. Yanez and officer Joseph Kauser remain on paid administrative leave.