Jennifer S. Altman for The New York Times

A 72-year-old Harlem business owner used a shotgun to blast four men who tried to rob his restaurant-supply business Thursday afternoon, killing two and sending two others to the hospital with gunshot wounds, the New York City police said.

The business, the Kaplan Brothers Blue Flame Corporation, at 523 West 125th Street, near Amsterdam Avenue, sells commercial gas and electric ranges, as well as parts and repairs.

The police said that the four would-be robbers entered the business and announced that they were robbing it. One of them took out a Glock 9-mm pistol and started to pistol-whip a 33-year-old employee inside the store. The owner then took out a shotgun and opened fire, striking the four men.

Public records identify the owner as Charles J. Augusto Jr., 72.

The police said they did not believe the shotgun — a Winchester 12-gauge pump shotgun with a pistol grip handle — had been registered, as city law requires. The police also recovered the pistol used by the would-be robber.

Calls about the shooting began coming in at 3:09 p.m. One man died at the scene and a second, who was taken to at St. Luke’s Hospital at 3:22 p.m., later died of his injuries.

A third man injured in the shooting walked into St. Luke’s — which is about 12 blocks to the south of the business, in the Morningside Heights section of Manhattan — with gunshot injuries. The fourth man was found nearby with gunshot wounds, the police said.

As the police cordoned off the scene, a large crowd of onlookers gathered around the site of the shooting. Near the business are two churches, Antioch Baptist Church and the Manhattan Pentecostal Church; the 26th Precinct station house; and the Our Children’s Foundation, an afterschool program.

Nearly two hours after the shooting, the body of a dead man lay on the sidewalk, its upper half covered in white plastic. The man wore gray pants and white shoes. The sneakers pointed up.

A woman who answered the phone at Mr. Augusto’s house in Irvington, in Westchester County, N.Y., said the family had no comment.

“They’re very upset, the people who live in the area,” said Sarah Martin, the president of the residents’ association at the General Grant Houses, one of the city’s largest public housing developments. The complex, which contains nine buildings and about 4,500 residents, is across 125th Street from the business where the shooting occurred.

Ms. Martin, who walked outside to look at the scene of the shooting, said that bystanders appeared to be sympathetic to the business owner. “People are saying things like, ‘How the hell are you going to try to rob someone in broad daylight?’ The police have it all blocked off.”

One bystander, Venus Singleton, 51, said that an employee at the business, known as J. B., was well-liked in the community. “I hope that the gun was licensed, and that he was in his rights,” she said.

Another bystander, Ricardo Gonzalez, 37, said he used to do odd jobs at Blue Flame for a few extra dollars. Mr. Gonzalez said the business’s owner, known to everyone as Gus, was also well-regarded in the neighborhood. “He’s a good dude, helps out the neighborhood,” Mr. Gonzalez said.

Mr. Gonzalez said that J. B. had worked for the business for at least a decade and was one of Gus’s most trusted workers.

According to a 1989 article in The New York Times, Blue Flame repairs old gas and electric commercial ranges. The article reported that Charles Augusto, president of the business, which was founded in the late 1920s, could repair stoves made as far back as the 1920s.

A 2001 item in The Times reported that Blue Flame also sold discounted commercial ranges and ovens that had once been used by restaurants.

A. G. Sulzberger, Bobby Allyn and Anahad O’Connor contributed reporting.