A former key associate of Ponzi scammer Nicholas Cosmo was sentenced to 18 months in prison Friday for his role in the $400 million fraud that cheated many blue-collar and civil servants on Long Island, officials said.

Anthony Massaro, 45, who personally pocketed more than $6 million in the scheme and had previously served time in federal prison for a separate conviction for importing heroin, faced up to 20 years in prison under federal sentencing guidelines, according to officials. Massaro, who pleaded guilty to conspiracy to commit mail and wire fraud, had met Cosmo in federal prison while Cosmo was serving time for a previous fraud scheme, officials said.

U.S. District Judge Denis Hurley in Central Islip said that Massaro’s criminal “conduct was atrocious.”

But in imposing the lesser sentence, Hurley noted that federal prosecutors said that Massaro had cooperated extensively with federal investigators, agreed to testify against others in the scheme, and had led an exemplary history since the scheme was exposed eight years ago.

Massaro even notified investigators of a more than $100,000 income-tax refund he had received that was seized, but might not have otherwise been discovered, according to Eastern District federal prosecutor Christopher Caffarone.

Cosmo has been sentenced to 25 years in prison and other associates, 9-, 7-, 6 1/2- years, and 30 months.

advertisement | advertise on newsday

In asking for a lenient sentence, including possibly just time served, Massaro’s lawyer, Chad Seigel, of Manhattan, said his client — who had lived in Queens, but now lives in Florida — spends much of his evenings after work counseling substance abusers, working with children at risk for committing crimes, participating in church activities, and studying for the ministry.

Hurley also ordered Massaro to serve three years of supervised release, make restitution of $179 million — the amount victims of the scheme lost — and forfeit the more than $6 million he had earned in the scheme. The government has seized about $1.2 million from Massaro, Caffarone said.

But the chances of victims getting much restitution or the government getting anymore forfeiture money are slim because Massaro has few assets, officials said.

Before he was sentenced, Massaro broke down crying and loudly sobbing, saying, “I would like to apologize . . . It was very selfish and self-centered . . . I would like to take it back . . . I would if I could.”

In the scheme, Cosmo and his associates promised 4,000 investors high returns on supposed safe investments in two Hauppague-based companies he set up: Agape World and Agape Merchant Advance, according to Caffarone. There actually were few investments, and, as is typical in a Ponzi scheme, the initial investors were paid with money from new investors, the prosecutor has said.