As he left, three off-duty officers confronted and killed him.
An off-duty agent from the Bureau of Alcohol, Tobacco, Firearms and Explosives was shot and killed during the shoot out.
John Copano had worked with the ATF for 23 years.
He leaves behind a wife and two children.
The ATF says special Agent John Capano was a veteran explosives expert who voluntarily spent more than four months in Afghanistan and Iraq helping American servicemen.
The robber lay dead on the sidewalk just outside the pharmacy he'd just robbed at gunpoint.
Workers inside Seaford's Charles Family Pharmacy on Merrick Road gave him what he wanted.
"He was looking for oxycontin and cash. At that time, he fled the store. When he fled the store, he encountered three people and those three people intervened. What we've come to find out is those three people are involved with law enforcement, two of them are currently from a law enforcement agency and the third is a retired law enforcement officer," Det. Lt. Kevin Smith from the Nassau County Police Dept. said.
Witnesses described several gun shots and then a young white male dropped to the sidewalk.
Agent Copano was also on the ground, bleeding.
"Both guys on the floor. Blood all over the place and apparently one guy was dead and drugs were laying all over the floor," eyewitness Matthew Hipp said.
The violent exchange happened about 2 p.m. Saturday.
It's unclear if the robber ever pulled the gun from his waistband or exactly who shot Agent Copano.
Copano was taken to Nassau County University Hospital where he died.
The incident was unfolding about 30 miles west of another Long Island pharmacy where four people were gunned down by a drug addict during a robbery in July.
(The Associated Press contributed to this report.)
Get Eyewitness News Delivered