Four men were injured in a shooting early Sunday in Brooklyn, authorities said.

The attack happened just after 3 a.m. at an apartment on Rockaway Parkway near Winthrop Street in Brownsville, according to police.

A 43-year-old man was shot in the left leg, a 37-year-old man was shot in the right leg and a 39-year-old man was shot in the stomach, police said.

The three men were taken to NYC Health + Hospitals/Kings County in stable condition, cops said.

A fourth man, who cops described as “uncooperative,” was grazed with a bullet in the right leg and treated at the scene, police said.

The motive behind the shooting was not immediately clear, according to police.