Cops shot an armed man in Crown Heights Wednesday after he was caught driving recklessly through the neighborhood, authorities said.

Kareem Thomas, 24, of Brooklyn, has now been charged with criminal possession of a loaded weapon and reckless driving, according to police.

The shooting happened just after 12 p.m. on Montgomery Street near Brooklyn Avenue after an officer noticed Thomas driving a white Mustang erratically and speeding, police said. The cop tried to pull the driver over, and in an attempt to flee, the suspect veered into oncoming traffic on Empire Boulevard just before Brooklyn Avenue where he collided into a parked flatbed truck.

RELATED: Two shot at Bed-Stuy subway station

He then got out of his car and fled on foot while the cop chased after him. Thomas then reached for his weapon as the officer caught up with him a few blocks later, reports said. The officer fired his gun, striking him in the torso.

Thomas was taken to Kings County Hospital in stable condition. The officer was transported to New York Methodist Hospital for observation.

A loaded semi-automatic Ruger firearm was recovered at the scene.