Louis Lanzano, Associated Press
Pedestrians walk past a cordoned off section surrounding the Marriot Marquis hotel where a shooting took place in the hotel's passenger drop-off area Thursday in New York.

NEW YORK — The mayor railed against gun violence on Friday, one day after a street peddler armed with a machine pistol died in a shootout with police outside a hotel in bustling Times Square.

Raymond Martinez, 25, was killed by a plainclothes sergeant Thursday after trading gunfire in an area crowded with tourists and holiday shoppers.

Mayor Michael Bloomberg was asked about the shooting while appearing at a Manhattan charity event, and he used the question to discuss one of his signature issues — illegal firearms and gun violence in New York and other big cities.

"We've got to stop this," Bloomberg said. "This is one of the great public health threats. And our police officers are clearly in danger."

Investigators were trying to determine whether Martinez was selling illegal weapons before he was fatally wounded in the taxi area of the landmark Marriott Marquis hotel. They say the gun he fired, a Mac-10 9 mm that held 30 rounds, was reported stolen in Richmond, Va., on Oct. 28.

Police say Martinez also was carrying several business cards linked to Virginia gun dealers near Richmond, in Hampton Roads and in Ivor. All the gun shops declined to comment.

One card had a handwritten message on the back: "I just finished watching 'The Last Dragon.' I feel sorry for a cop if he think I'm getting into his paddy wagon," according to police. It's unclear who wrote the message, which apparently references a 1985 martial arts movie.

"We keep getting this lesson every day," said Bloomberg. "If you think of all the publicity about the terrible tragedy of Virginia Tech, we have a Virginia Tech in this country every day. It's just spread across 50 states."

The shootout occurred in the theater district. Bullets shattered windows at the Broadway Baby souvenir store and a box office.

Broadway Baby manager Jonathan Erlich was still reeling Friday. Police said he was lucky to be alive.

He said he heard "Boom! Boom! Boom!" and "a quick splat of glass" before ducking behind the counter.

"That was a bullet!" he recalled screaming.

The slug sliced down the center of a book about the show "Wicked," struck a souvenir baseball and lodged in a shelf holding "I Love New York" T-shirts.

"It's insane no one else got hurt," said Erlich.

Sgt. Christopher Newsom operates a task force that monitors aggressive panhandling and was patrolling with an anti-crime unit. He recognized Martinez and his brother from past run-ins. He asked to see tax stamps, required for street peddling.

Martinez ran; Newsom pursued.

Martinez turned and fired a machine pistol that held 30 rounds, getting off two shots before it jammed, police said. The officer fired four times, striking Martinez in the chest and arms.

"We're lucky the weapon jammed," said police Commissioner Raymond Kelly.

He said the shooting preliminarily appeared to be within department guidelines, which allow for deadly force when an officer's life is threatened.

Martinez's brother, Oliver, returned to the family's Bronx home Thursday evening after hours in custody. Another brother, Anthony, cried out that he hates police: "They shot my brother!" he said, hugging Oliver.

Police say it's not uncommon to arrest hawkers on more serious charges. Police Capt. Edward Winski said there have been more than 400 peddler arrests this year and illegal activity has been increasing.

Police said the Martinez brothers were cited previously for not having their stamps. They were also suspected of running a scam: asking someone's name, writing it on a CD and then demanding payment of $10.

But their cousin, Nailean Arzu, said the slain man had been lawfully selling CDs for years.

"Everybody loved him," she said. "It's a great loss to the family."

Police spokesman Paul Browne said officers pay special attention to scams and panhandling during the holidays. Specialized units are set up in areas, including Times Square and Canal Street, where stolen goods, knockoffs and scams are prevalent.

"We focus on them this time of the year, because they're preying on tourists during the Christmas holidays," Browne said.

Associated Press writers Tom Hays, Ula Ilnytzky, Sara Kugler, Chad Roedemeier and Cristian Salazar contributed to this report.