PHOENIX  Weeks after a shooting left six dead and 13 injured in Tucson, New York City sent undercover investigators to an Arizona gun show and found instances in which private sellers sold semiautomatic pistols even after buyers said they probably could not pass background checks, city officials said.

The investigation, part of an effort by Mayor Michael R. Bloomberg’s administration to crack down on illegal gun sales nationwide, took place Jan. 23 at the Crossroads of the West Gun Show in Phoenix, officials said.

“The background check system failed in Arizona, it failed in Virginia and it fails in states around the country,” said John Feinblatt, an adviser to Mr. Bloomberg. “If we don’t fix it now, the question is not whether another massacre will occur, but when.”

Private, unlicensed sellers are not required to run federal background checks, but it is a violation of federal law to sell guns to people if sellers suspect they are felons or mentally ill or are otherwise prohibited from buying. In the case of Jared L. Loughner, who is accused of opening fire on the crowd in Tucson on Jan. 8, the gun used in the shootings was bought at a licensed gun dealer, and he passed a background check, the authorities said.