Police on Tuesday were investigating an early morning shooting in Brooklyn that possibly involved an off-duty NYPD officer.

It happened near Flatbush and 6th Avenues in Park Slope.

Investigators believe there was a robbery taking place.

"The neighborhood is very quiet, very peaceful. My son goes out late at night and walks around all the time, and nothing happens. I just suddenly heard these shots. The neighborhood is usually wonderful. I guess every so often something awry happens in a wonderful neighborhood too," said one witness.

The Sergeants Benevolent Association sent out a tweet earlier in the day saying the man who was shot was trying to rob the officer.

An off-duty officer was at the scene and although his involvement is not yet clear, sources say he was with the victim at the time of the attempted robbery.

Police say shots were fired and a 32-year-old man was hit in the right leg.

He was taken by private means to Methodist hospital and is in stable condition.

The officer was not hurt.