The shot that killed a federal ATF agent trying to stop a robbery at a Seaford pharmacy most likely came from a retired Nassau police lieutenant's gun in a moment of deadly, tragic confusion, law enforcement sources said.

Sources briefed on the investigation said the fatal round was believed to have come from the gun of retired Nassau police Lt. Christopher Geraghty, 54, of Woodbury.

Nassau police spokesman Det. Lt. Kevin Smith declined to comment on the possibility that federal agent John Capano was mistakenly killed by another responder's gunfire during the chaotic melee Saturday afternoon outside Charlie's Family Pharmacy at 3931 Merrick Rd.

As Capano's grieving family prepared for his funeral, Nassau County and federal investigators Monday were developing a firmer account of how he died based on witness interviews and ballistics tests on the bullets that killed Capano, 51, and the robber.

Surveillance video captured the robbery, but not the shooting of Capano, an off-duty senior agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives, sources said.

Capano, of Massapequa, was at the pharmacy getting a prescription for his father when the robbery unfolded. Ex-convict James McGoey, 43, of Hampton Bays, brandishing what turned out to be a pellet gun, demanded and got prescription painkillers and cash.

advertisement | advertise on newsday

As McGoey began to walk out of the store, Capano, his gun drawn, trailed him from a parallel aisle and then confronted him, two sources said. Capano shot and wounded McGoey in the leg or hip, according to some accounts, and the struggle spilled out the doorway.

Moments earlier, a bystander had run into a nearby deli and said the drugstore was being robbed.

Geraghty and off-duty New York City Police Officer Joseph Arbia, 29, of Seaford, ran out of the deli, came around an alleyway next to the drugstore, their guns out, and -- yelling "police, police," according to some accounts -- came upon the gun-wielding agent and the robber.

Arbia or Geraghty -- accounts differ as to which one -- grabbed for Capano's pistol, not realizing he was a federal agent, the sources said. A gun believed to be Geraghty's went off during the struggle, the sources said. Capano fell, mortally wounded by a bullet that tore through his aorta, a source said.

When McGoey allegedly attempted to grab Capano's gun after it was knocked loose during the struggle, Arbia shot him several times, killing him, the sources said.

Attempts to reach Arbia and Geraghty Monday were unsuccessful.

New York State records do not show a listing for the owner of the Seaford Deli where Geraghty and Arbia were, but the deli's past owner, Erik Erichsen, said he sold it to Geraghty in 2006. Erichsen said he knew the Capanos as longtime customers. "It's sad," he said of Capano's death.

Outside the pharmacy Monday, bloodstains were visible on the Merrick Road sidewalk.

Customer John Pascucci, 37, of Seaford, a former NYPD officer who is an electrician, visited the drugstore Monday morning to pick up a prescription after it reopened for the first time since the shooting. Pascucci, a longtime customer, expressed sympathy for the officers involved in the shooting.

"God willing, they'll find out that it wasn't friendly fire," he said. "I feel bad for the officers. . . . It's a very, very tough thing to do, when you put someone [off-duty and retired officers] in harm's way who shouldn't have been."

advertisement | advertise on newsday

McGoey had a long list of drug arrests, including convictions for three pharmacy robberies, and served about 20 years in state prisons. He was released from Attica Correctional Facility just last August, after robbing a Setauket pharmacy of Valium and cash in 2000, records show.

Prison records indicate McGoey continued to struggle with drug addiction while imprisoned over the past decade.

Records show he was disciplined more than a dozen times for having and using drugs, harassment, fighting and disobeying orders.

After his August release, he was visited by a parole officer at his Hampton Bays home twice, most recently on Dec. 17.