Undercover detectives arrested two men Wednesday night in Massapequa as part of a crackdown on heroin, Nassau County police said.

As part of the Long Island Heroin Initiative, Nassau Narcotics/Vice Bureau detectives arrested the men -- identified as Joshua Moore, 24, of 175A Calebs Path, Central Islip, and Edward Brooks, 57, of 357 Grand Blvd., Brentwood -- after what police said was a drug buy in the parking lot of a Pathmark supermarket on Carmans Road at 9:15 p.m.

Police said the investigation was done in cooperation with agents from the Drug Enforcement Administration's Long Island District Office.

PhotosRecent LI mug shotsDataLI crime stats

A DEA spokeswoman said the agency was not involved in the operation.

The arrests followed a short foot pursuit, police said, that ensued when the two men realized they were about to be arrested after selling the officers heroin and crack.

Moore and Brooks were charged with two counts each of third-degree criminal sale of a controlled substance, as well as third-degree criminal sale of a controlled substance.

advertisement | advertise on newsday

At arraignment Thursday, Moore's bail was set at $25,000 and Brooks' at $100,000.

Moore was represented by Legal Aid, which does not comment on cases. The name of Brooks' attorney was not immediately available.

With Ellen Yan