Four people were shot, one fatally, when a gunman opened fire in a Brooklyn housing complex Wednesday night, police said.

The victims were standing in a hallway of the building on Fulton Street near Utica Avenue in Bedford-Stuyvesant when shots rang out at about 10:30 p.m., police said.

One of the victims, a 20-year-old man, was pronounced dead at the scene.

A 55-year-old woman and another 20-year-old man were wounded but expected to survive, police sources said.

A 22-year-old woman suffered a graze wound.

A relative of one victim said the group was leaving his apartment on the third floor when shots were fired.

“They didn’t do anything to deserve this,” the anguished family member said.