Police officers were fired on from the building while looking for 64-year-old Kurt Myers, state police Superintendent Joseph D'Amico said. D'Amico said at least one officer returned fire, but Myers' status was uncertain.
"We're in no rush to bring this to a conclusion," D'Amico said, adding that the main objective was to make sure no one else was hurt.
Police said the rampage started with a fire in Myers' apartment in the village of Mohawk on Wednesday morning.
D'Amico said the gunman drove to a barber shop around the corner and used a shotgun shot to kill two customers, whom he identified as Harry Montgomery, 68, and Michael Ransear, 57. The shop's owner, John Seymour, and another customer, Dan Haslauer, were listed in critical condition at a regional hospital.
D'Amico said the gunman then drove to a mechanic's shop in nearby Herkimer and used the shotgun to kill Thomas Stefka, an employee, and Michael Renshaw, a customer.
"Everybody's on lockdown, all the schools, the college, the village," said Amanda Viscomi, Herkimer's acting clerk-treasurer. "It's very, very scary."
D'Amico said police had had no communication with Myers, whose only known police record was a 1973 drunken driving arrest.
Police were positioned in front of a block of small businesses topped with apartments on Wednesday evening. A local businessman, Fred Weisser, said police were trying to get people out.
"They're sending in a robot to check the place out," Weisser said by telephone. "I guess we're stuck. We're between him and the cops. I don't want to step out and get clipped by a sniper."
Myles Smith, who lives in an apartment above the shops, said by phone he had heard police trying to talk to Myers.
"The snipers on the roof are sitting there," Smith said. "I ain't seen a whole lot of movement. I heard about five gunshots. I keep hearing them trying to talk him out, but I don't think he's coming out."
Neighbors said they barely knew Myers, who rarely spoke.
"He would walk by himself. He was kind of a loner. No wife," next-door neighbor Traci Randall said.
Gary Urich said Myers wouldn't even say "Hi" to him when walking by his porch.
"I said, 'How are you doing?' No response. He just walked by," he said.
Michele Mlinar, who tends bar at Cangee's Bar and Grille in Herkimer, said Myers frequently went in and had a bottle or two of beer and left without speaking to anyone. She said he was always alone and she didn't even know his name until police released his mug shot.
Cangee's owner Candy Rellin called Myers "just an odd little man."
Guns and ammunition were found inside an apartment at Myers' building, but it was unclear whether they were from his apartment.
James Baron, the mayor of Mohawk, said he didn't know Myers but knew several of the people who were shot. The mayor described the village as close-knit and friendly, "the kind of place where you'd say, 'Oh, it would never happen here.'"