Two people were killed and nine wounded Friday when a laid-off apparel company employee gunned down a former co-worker near the Empire State Building, then was fatally shot in a hail of police gunfire outside the New York landmark, authorities said.

The gunman killed the former co-worker with a .45 caliber handgun less than a block away from the Empire State Building and was followed by a construction worker, who alerted police, Mayor Michael R. Bloomberg (I) told reporters at the scene. He said the shooter, identified as Jeffrey Johnson, 58, of Manhattan, then drew his weapon and attempted to shoot two police officers, who opened fire and killed him.

Bloomberg said some of the nine people who were hit outside the Empire State Building may have been shot accidentally by police. He said it was not clear whether the gunman managed to fire his weapon at that point. But he said none of the wounded have life-threatening injuries.

“This has nothing to do with terrorism,” Bloomberg said. He called it a “terrible tragedy,” adding that “there’s no doubt that the situation would have been even more tragic but for some extraordinary acts of heroism.”

New York Police Commissioner Ray Kelly identified the murder victim as a 41-year-old man. He said the shooter worked for six years as a designer of women’s accessories at Hazan Imports on West 33rd Street before he was laid off about a year ago in a company downsizing. He described Johnson as a “disgruntled employee.”

Officials later identified the victim as Steven Ercolino, a company vice president. Kelly said the two had accused each other of harassment when Johnson worked at Hazan Imports.

Kelly said Johnson shot his former co-worker three times at close range outside the business, hitting Ercolino in the head.

Kelly said Johnson left the scene carrying his weapon in a black bag under his arm. He said the construction worker who followed him alerted two uniformed police officers who were on routine counterterrorism duty outside the Empire State Building’s Fifth Avenue entrance.

“As the two officers approached Johnson, he pulled his .45 caliber semiautomatic pistol from his bag and fired on the officers, who returned fire, killing him,” Kelly said. “An additional nine individuals were either wounded or grazed during the exchange.”

Bloomberg, speaking at the same news conference, offered a different account on one key point, saying investigators have not yet determined whether Johnson fired any shots at police. He indicated that the shooting outside the Empire State Building was captured on security cameras.

“We do know that — we have on tape — the perpetrator pulled his gun out and tried to shoot at the cops,” the mayor said. “Whether he got off any bullets or not — to be determined. How many he shot earlier — to be determined. We do know that the cops fired back.” He said there was no evidence than anyone besides the two police officers fired at Johnson.

Kelly later said the two officers fired a total of 14 shots at Johnson, whose handgun apparently could not have accounted for all the wounded. Its magazine could hold only eight rounds, and at least one round remained in it, police said. A second, loaded clip was found in his bag.

Johnson legally bought the gun in Sarasota, Fla., but did not have a required permit to possess it in New York, police told the Associated Press.

Bloomberg, a well-known proponent of stricter gun laws, said New York is “the safest big city in the country ... but we are not immune to the national problem of gun violence.”

“Once again, there’s an awful lot of guns out there,” Bloomberg said in concluding the news conference.

Law enforcement sources in Washington also said the shooting appeared to have no connection to terrorism.

A New York Fire Department spokesman said a call about the shooting was received shortly after 9 a.m. and that emergency units arrived within minutes at the scene at 34th Street and Fifth Avenue.

After the shooting, the body of the gunman lay on the sidewalk under a white sheet outside the Empire State Building, a major tourist attraction that draws long lines of visitors during the height of the summer tourist season. Police cordoned off the building and pushed a large crowd of tourists back half a block.

The 103-floor Empire State Building draws more than 10,000 visitors each day. According to its Web site, about 20,000 people work in the building, which opens for visitors at 8 a.m. daily.

Robin Mueller, a tourist from Germany who was on his way with his father to see the Empire State Building on Friday morning, said he was stunned by the shooting.

“It’s crazy. I’m shocked,” he said. “We read in school about gun control, and how it’s insecure in the U.S. If everyone has a gun, everyone can shoot. It’s dangerous.”

Colum Lynch in New York and Sari Horwitz in Washington contributed to this report.

Colum Lynch in New York and Sari Horwitz in Washington contributed to this report.