Department of Justice, File, Associated Press
FILE - This undated file photo provided by the U.S. Department of Justice shows Alcohol Tobacco and Firearms Special Agent John Capano, who died while trying to subdue a suspect in a pharmacy robbery in Seaford, N.Y., Saturday, Dec. 31, 2011. A law enforcement official speaking on the condition of anonymity told The Associated Press on Tuesday, Jan. 3, 2012 that Capano likely was shot by a retired Nassau County police lieutenant who had been down the street at a deli and responded to the robbery along with an off-duty New York police officer. Off-duty and retired law enforcement officers appear to have few protocols to follow when confronting a crime out of uniform, like the apparent friendly fire that left John Capano dead on New Year's Eve.

GARDEN CITY, N.Y. — An attorney for a retired police lieutenant who fired the shot that killed a federal agent trying to thwart a New Year's Eve pharmacy robbery says his client is "devastated" by what happened.

Attorney Brian Davis said in an interview Thursday that retired Nassau County police Lt. Christopher Geraghty had sent a personal note of condolence to the relatives of Bureau of Alcohol, Tobacco, Firearms and Explosives agent John Capano and hopes to meet with them.

Capano, 51, was shot Saturday while struggling with a suspect during a robbery for prescription painkillers and cash at a small family pharmacy in Seaford, on Long Island, about 25 miles east of New York City.

The explosives expert, who served in Iraq and Afghanistan, had gone to the pharmacy to fill a prescription for his cancer-stricken father and followed the suspect outside. At about the same time, someone had run into a nearby deli and shouted that the drugstore was being robbed.

Geraghty and an off-duty New York Police Department officer eating in the deli ran out the back of the deli and down an alleyway to the scene three doors down, where they found Capano and the robbery suspect wrestling on the sidewalk, Davis said.

"He came upon the fight out front of the pharmacy as these two men struggled for the weapon," Davis said.

Davis said Geraghty, "not knowing who was who," kept pleading to learn "who the good guy was."

Capano, who was armed with his service weapon, and the robbery suspect continued to struggle over the weapon when it discharged a shot only inches from where Geraghty was, Davis said.

Geraghty, Davis said, "thought the person who fired it was the perpetrator, the bad guy, because it had been aimed at him and he had been identifying himself as a police officer."

"And this," Davis said, "was an instantaneous reaction to fire back."

Moments later, the off-duty NYPD officer shot and killed the robbery suspect, 43-year-old James McGoey, who had a long record of pharmacy holdups.

Capano is the first ATF agent to be killed by gunfire in the line of duty since the infamous raid on a religious cult compound in Waco, Texas, in 1993, an agency spokesman said Thursday.

Nassau County police have not discussed details of the case, citing an ongoing investigation. The district attorney's office also is investigating the shooting.

Davis said the fatal friendly fire shooting will be with Geraghty "for the rest of his life."

"His prayers are with the family," Davis said, "and at some point in the future he does want to see them personally and privately."

Capano's family has said it has no criticism of the actions of the officers who sought to help.

"We only blame one person for the whole thing, and that was the criminal," Capano's brother-in-law Tony Guerriero told Newsday.

The officers at the scene "were all there to do their job, and it just played out the way it played out," he said.

Capano, a 23-year member of the federal firearms bureau who taught U.S. military members and local forces in Afghanistan and Iraq how to investigate explosions, likely never hesitated to intervene in the robbery, colleagues have said.

"As law enforcement officers, we go to crimes; we don't run away from them. And that's exactly what he did. In his mind I'm sure he had no choice," said Eric Immesberger, the agent in charge of the ATF's Long Island office.

It was the second deadly holdup in a pharmacy on Long Island in 2011. In June, a gunman opened fire in a drugstore in Medford, killing two employees and two customers before fleeing with a backpack filled with painkillers.

Capano's shooting is the second friendly fire incident in Nassau County in the last year. A Nassau police officer in plainclothes was shot to death in March by a transit authority officer in Massapequa Park.