A man was shot by a police officer in Brooklyn yesterday after allegedly pointing a gun at cops.

Officers were called to a disorderly gathering at Liberty and Van Siclen avenues in East New York at about 4:30 a.m., police said.

When they arrived, a 23-year-old man, who was not identified, allegedly ran two blocks, turned and pointed a 9-mm gun at officers. Police said an officer fired his gun, hitting the man in the chest.

The man was taken to Jamaica Hospital in stable condition. Police recovered the loaded gun.