A Hempstead man pleaded guilty Tuesday to committing 40 knifepoint robberies on Long Island and in Queens over 16 months, telling a federal judge he needed cash to support his addiction to heroin.

Khalif House’s crime spree began in February 2015 in North Woodmere and ended in June when he was arrested in Floral Park, authorities said.

“What did you do?” U.S. District Judge Joan Azrack asked House Tuesday in her Central Islip courtroom.

“Committed a number of knifepoint robberies to get money for my heroin addiction,” he told the judge.

House, 24, pleaded guilty to one count of conspiracy to commit armed robberies. Under federal sentencing guidelines — rules aimed at setting a uniform sentencing policy — the prison time House could receive is estimated to be between 70 and 87 months, according to House’s defense lawyer and Assistant U.S. Attorney Mark Misorek.

Azrack did not set a sentencing date.

advertisement | advertise on newsday

House admitted he used a knife to rob small businesses in Queens, Nassau and Suffolk, including 11 Subway sandwich shops, nine Dunkin’ Donuts, and six Carvel ice cream stores. Misorek said House wielded a butcher knife in the holdups.

House — who Misorek said was helped by his girlfriend, Lisette Veltri, on some occasions — got away with a total of $18,633 in cash. The smallest amount was $100. The largest amount — $1,500 — came from the May 18 robbery of a Subway sandwich shop at 66 Sunrise Highway in Lindenhurst.

Authorities charged House with 27 robberies after his June arrest but the number of holdups investigators suspect he committed rose after police identified him, according to Misorek.

Veltri faces a charge of interfering with interstate commerce by robbery. She was released on $150,000 bond after her arrest. Veltri’s case is pending.

Police departments reviewed unsolved robberies in the three counties and believed House was responsible for 13 more, Misorek said. Before prosecutors could charge House with the additional 13 robberies, he entered into an agreement with the government.

The evidence against House included a pair of mismatched gloves the Hempstead man had in his possession when he was taken into custody, Misorek said. The gloves, Misorek said, match those worn by the robber in some of the heists. Veltri also identified House as the robber captured on surveillance cameras during some of the holdups.

A woman identified as House’s mother by his attorney, Murray Singer of Port Washington, came to court Tuesday. Singer said said she did not want to comment.

“He’s a very nice young man, from a very nice family,” Singer said.