Updated

When police responded to a report of shots fired near San Francisco in February 2011, they wound up in a standoff with 29-year-old Joseph Camilleri and his girlfriend. The two were barricaded inside a home with as many as 20 guns, including 12 illegal assault weapons and thousands of rounds of ammunition.

On Friday, federal and state prosecutors alleged that two of the machine-pistol type weapons were sold to Camilleri by a Sacramento County sheriff's deputy abusing an exemption in state law that lets peace officers buy weapons that are illegal for civilians to own.

They charged Ryan McGowan, 31, and fellow deputy Thomas Lu, 42, with violating federal law by acting as straw buyers to purchase the restricted handguns, which they then sold to unqualified buyers through a licensed dealer who also faces federal charges.

U.S. Attorney Benjamin Wagner said the pair made thousands of dollars by selling dozens of weapons over four years. Court documents say the men sold exotic weapons including .50 caliber handguns, semi-automatic versions of Uzi-style submachine guns, and pistols that shoot high-velocity ammunition used by the U.S. military.

Sacramento County District Attorney Jan Scully said Camilleri had altered the two pistols he bought from McGowan into illegal assault weapons.

After the Daly City standoff, Camilleri eventually pleaded no contest to a reduced charge as part of a plea agreement, and was sentenced to three years' probation and 90 days in jail.

Scully said another gun sold by McGowan wound up in the possession of a convicted drug dealer.

"These are just a couple of cases where these illegal guns end up on the streets and in the hands of criminals," Scully said. "McGowan put the safety of our community at risk by abusing his position as a law enforcement officer for his own personal gain."

McGowan also is charged with selling high-capacity ammunition magazines that are illegal for civilians to own in California, and with possessing two illegal assault weapons at his home.

McGowan's defense attorney, William Portanova, said his client is a gun collector, not a dealer, who may have been confused by state firearms laws that he said are "complex, contradictory and full of silly loopholes."

"They are so complicated that you can easily break the law without realizing you've done that," he said. "Even a trained law enforcement official can do it wrong, whether he intends to or not."

Two other Sacramento-area police officers also were implicated in illegal weapons sales but not charged because they didn't turn large profits, Wagner said.

California law bars citizens from buying handguns that have not been deemed safe by the state Department of Justice, but the law exempts peace officers. Officers also can buy high-capacity magazines.

If they get authorization from supervisors, they also can buy assault weapons. The Associated Press reported in December that California law enforcement agencies registered more than 7,600 assault rifles for individual officers, many for the officers' personal use, since their ownership was restricted for civilians a decade ago.

"These are particularly kind of dangerous weapons," Wagner said. "There's a reason why they are not publicly offered for sale. So there is a public safety concern with the proliferation of these weapons, essentially the exploitation of this loophole, to disseminate a large amount of these weapons to the public."

Investigators are now interested in whether the privilege is being abused by other California peace officers, Wagner said.

"It is very possible it is happening. I think it's unlikely to say that it is a widespread practice," Wagner said.

The federal investigation led Assemblyman Roger Dickinson, D-Sacramento, to propose legislation to close what he calls a loophole in the state's "unsafe handguns" law, passed in 2001.

Peace officers and members of the military are required to use a registered firearms dealer if they want to sell their privately owned weapons. But current law does not require the dealer to make sure the ultimate buyer is also eligible to own handguns that aren't on the Department of Justice's list of approved weapons.

Dickinson said his AB2460 would require dealers to check whether weapons are considered "unsafe handguns," and sell them only to other law enforcement officials or members of the military who are exempted under the law. The bill passed the Assembly in May and is awaiting action in the Senate.