A police officer shot a 24-year-old hardened criminal in Brooklyn after he reached for a gun during a foot pursuit, police sources said.

Brooklyn gang member Kareem Thomas, 24, was spotted by the cop driving recklessly on Empire Blvd. in Crown Heights at about 12:15 p.m.

Thomas then struck a flatbed lumber truck, pulled over and bolted from his white Mustang on Brooklyn Ave. near Montgomery Street with a gun in hand. The cop chased him on foot, police said.

Thomas fell on Montgomery Street and dropped his 9mm semi-automatic Ruger handgun, police said.

As he reached for the black and silver gun, the cop fired at him twice, hitting him once in the lower abdomen, police said.

He was taken to Kings County Hospital where he is expected to recover, cops said.

“I saw him running up the block. I saw the gun in his hand,” Abe Lavin, a worker in a nearby store said. “I saw one cop chasing him. [The cop] said, ‘Stop!’ and he [Thomas] kept running.”

Thomas, who has 15 prior arrests, was in Brooklyn Supreme Court earlier in the day to set a trial date for his attempted murder charge.

In 2011, Thomas allegedly shot another man in Brooklyn and was hit with the attempted murder charge.

He also has an open case for criminal possession of a weapon, felony assault and resisting arrest.

He was out on $50,000 bail until his arrest in Brooklyn today, according to the District Attorney’s office.