An 18-year-old motorist admitted in court Tuesday he was under the influence of marijuana and alcohol when he struck and killed another driver in 2014 in New Hyde Park.

Deepak Kumar accepted a deal calling for him to serve 4 years in prison in return for his guilty plea to all 14 counts in his indictment, including the top charge of aggravated vehicular homicide in the death of Sir Pierre Antoine, 55, of Richmond, California, on Aug. 19, 2014.

Kumar faced up to 8 1/3 to 25 years on the most serious charges, and prosecutors had asked for a flat sentence of 6 years.

“The court believes it is in the interest of justice to accept the plea from this defendant,” Judge Robert McDonald said.

Kumar, who lives with his parents in New Hyde Park, remains free on bail pending sentencing March 23. His mother and other family members hugged him as they left court in tears. The family declined to comment.

The victim’s brother, Harry Antoine of Hempstead, said outside court that the family was satisfied with the terms of the plea agreement.

advertisement | advertise on newsday

“We’ve been through so much and we understand that going to trial meant there’s a chance the sentence would not be as severe if he was convicted of a lesser offense,” Antoine said.

Kumar, a native of Pakistan, told the judge he understood that he could be deported for pleading guilty to a felony.

Defense attorney Michael DerGarabedian of Rockville Centre said outside court he and the Kumar family were satisfied with the plea.

“It’s exactly what I wanted from the inception of this case. I wanted to avoid having to litigate this, having the victims and the [Kumar] family going through it,” he said.

“The district attorney and I disagreed on the sentence. This corrects a mistake and avoids another mistake. If it were not for the wisdom of the judges, I don’t think this would have been resolved. It [a trial] would have been another tragedy for both families,” he said.

District Attorney Madeline Singas said in a statement: “My office will always remain unyielding in our pursuit of justice for the wife and daughter of this loving husband and father.”

Prosecutors had said Kumar was driving at a high speed when he crashed into Antoine’s rental car at Second and Covert avenues. Antoine’s wife, Marta, and his 6-year-old daughter also were injured.

Antoine, a supervisor at a California bus company, was on Long Island to visit his hospitalized mother.