A former NYPD officer was sentenced to 20 years in federal prison yesterday for robbing drug gangs and holding children at gunpoint as a member of a violent stickup crew.

Jorge Arbaje-Diaz, 33, admitted he wore his police uniform and badge and wielded his service pistol during some of the heists, and eventually stole more than 1,650 pounds of cocaine and $4 million in illicit drug proceeds from dealers.

“You are the poster boy for a sentence that will deter others from the kinds of acts you engaged in,” Brooklyn Judge Nicholas Garaufis said.