HOLLYWOOD, Fla. — A man dressed in black opened fire with a pistol in the lobby of his apartment building Friday, killing two people and wounding two others before shooting himself, police said.

A suicide note was found inside his apartment, but its contents were not made public. Police did not release the gunman's name but said the 35-year-old man was under psychiatric care.

He shot at people randomly with a five-shot revolver, said Detective Carlos Negron, a police spokesman. The gunman exchanged shots with police as the area was sealed off and a SWAT team was called in.

Negron identified the victims as Dawn Garcia, 20, and Ben Neivert, 81. Two other women, one of whom was 12 weeks' pregnant, were hospitalized in critical condition.

Police said the man was found in the lobby with a gunshot wound to the head.

The shootings were reported around 10:45 a.m. at the Town House Apartments on Hollywood's Young Circle, a busy neighborhood with businesses and homes.

Rocky McDonald, 37, said he saw a woman with blood on her chest after leaving his apartment and taking the elevator to the lobby. He said the gunman shot at him but missed as he tried to check on the woman.

The gunman told him to get away from her, and McDonald ran up a staircase.

"I thought this might be my day. If he wanted to he could have shot me then, but he didn't. I guess there's another purpose for me to be here a little longer," a shaken McDonald said, holding his girlfriend.