A man shot three people — one fatally — in the hallway of a Bedford-Stuyvesant building early Sunday after he was denied entry to a wild house party, cops said.

The shooter squeezed off several rounds in the Macon Street building at around 3:30 a.m., striking Christopher Bell, 29, in the neck, police said. Two other men, 29 and 27, were wounded, but not seriously.

The gunfire set off a stampede of revelers toward the exit — including the mortally wounded Bell, who staggered for about a block before collapsing.

“The whole party emptied out, and everyone went running for the door at once,” a neighbor said. “I watched from my window as people were falling over each other to get out.”

The gunman, who was still at large Sunday, continued firing wildly as he ran away.