A recovering heroin addict who admitted he committed 40 knifepoint robberies across Long Island over a 16-month period to feed his drug habit was sentenced to 10 years in prison Thursday by a federal judge.

During a sentencing hearing in Central Islip federal court, U.S. District Judge Joan M. Azrack told defendant Khalif House that she was imposing a stiffer punishment than the 87 to 108 months suggested by sentencing guidelines because of the violent nature of his crimes and the sheer volume of robberies he committed.

Assistant U.S. Attorney Mark Misorek and other prosecutors say House, 25, brandished a butcher’s knife when he stole more than $18,000 from dozens of small businesses in Nassau, Suffolk and Queens counties between February 2015 and June 2016. The targets included 11 Subway sandwich shops, nine Dunkin’ Donuts and six Carvel ice cream stores.

“Mr. House committed a lifetime of robberies in 16 months,” Misorek said.

House was apprehended on June 8, 2016, while hiding in a van in Floral Park following a manhunt involving hundreds of law-enforcement officers.

House admitted that he committed the robberies when he pleaded guilty to one count of conspiracy to commit armed robberies in December.

advertisement | advertise on newsday

His girlfriend Lisette Veltri, who court documents say acted as a lookout and getaway driver during 29 of the robberies, pleaded guilty to the same charge in November. Veltri has not yet been sentenced. Her attorney, Peter Tomasso of Kew Gardens, did not return a request for comment.

Defense attorney Murray Singer of Port Washington asked Azrack for a more lenient sentence, arguing that House only committed the robberies because he needed money for his heroin addiction. He said House did not deliberately hurt anybody during the robbery spree and that he had completed a drug detox program while incarcerated.

“He needed to get caught to get the treatment he is now receiving,” Singer said.

Prosecutors, however, said the stiffer penalty was warranted because House chased down a fleeing employee during a April 2016 robbery of a Commack Carvel and dragged her back to the store.

He also cut the hand an employee of Evans Corner Store in Valley Stream who attempted to disarm him during a February 2015 robbery. Singer said that injury was accidental.

Azrack agreed, saying 108 months was an inadequate sentence given how many people House terrorized during his crime spree.

“The public was placed at risk in each of these robberies,” she said.

House, wearing a tan prison uniform, apologized to the victims and to his mother and family for the pain he has caused them.

A woman identified by Singer as House’s mother quietly sobbed during the apology. She and other family members declined to talk about her son or his sentence after the hearing.

Victims and witnesses to House’s robberies did not appear at the sentencing.