A Suffolk judge on Wednesday sentenced a convicted murderer to 25 years to life for fatally running over “a good man” with the man’s own car as the victim picked up food for the needy the day after Thanksgiving.

“You killed a good man, and murder has consequences,” state Supreme Court Justice William Condon said in his Riverhead courtroom as he sentenced Edwin Gutierrez to the maximum term.

In August, a jury convicted Gutierrez, 49, of Manhattan, of two counts of second-degree murder — one with depraved indifference, the other while committing another felony — in the death of Dionel Ramirez of North Amityville.

Gutierrez, who also was convicted of first-degree robbery and third-degree attempted grand larceny, had struck Ramirez, 69, while trying to steal his car as Ramirez collected day-old baked goods from a North Bay Shore 7-Eleven in 2014.

Ramirez, an Army veteran from Guatemala who worked cleaning movie theaters, had been planning to take the food to feed the homeless, his usual routine, his family said.

Prosecutors said the key to Gutierrez’s conviction was a 7-Eleven surveillance video that showed him arriving at the store at 4:30 a.m., then trying to steal the vehicle of another customer in the parking lot.

advertisement | advertise on newsday

Gutierrez waited for an hour before he jumped into Ramirez’s Hyundai, which was left running unattended in the store’s parking lot, authorities said. Ramirez ran and stood in front of the car when he noticed what was happening, but Gutierrez hit the gas, running him over, according to authorities.

In court Wednesday, Gutierrez, reading remarks in Spanish, told Condon he had been celebrating his birthday on the day of the crime and had blacked out from drinking. He said he didn’t remember what happened, but didn’t mean to kill Ramirez.

“For me, I think this is manslaughter. What happened was an accident, and I don’t deserve the 25 to life,” he said, according to a court interpreter.

His message to Ramirez’s family: “Forgive me for the damage that I did to them,” he said.

But Gutierrez appeared to anger Condon when he asked the judge to waive $350 in court fees.

Condon scolded Gutierrez for being concerned about the surcharge when Ramirez’s widow “is grieving the loss of her husband, her children are grieving the loss of their father...”

Condon added: “And you know what really galls me, given the type of man that Mr. Ramirez clearly was, if you would’ve asked him for a lift, he probably would’ve given you one, happily.”

“I was drunk,” Gutierrez said.

advertisement | advertise on newsday

“You were drunk,” Condon repeated incredulously.

Before Condon handed down his sentence, Suffolk Assistant District Attorney Robert Biancavilla said Gutierrez’s criminal record stretched back about 23 years, including alcohol-related offenses and assault convictions. Court records show Gutierrez was sentenced in 2004 to four years for a first-degree attempted robbery conviction.

Gutierrez hasn’t been “a productive member of our society and has in fact been a menace to society,” Biancavilla said.

After court, Gutierrez’s attorney, Martin Lorenzotti of Central Islip, said his client “is very contrite, sympathetic and upset about what happened.”

Gutierrez’s cousin, Antony Santiago, 48, of Brooklyn, said after the sentencing that Gutierrez was a hard worker who detailed luxury cars at a dealership. He had been struggling with the death of his nephew and his father’s stroke at the time of the crime.

advertisement | advertise on newsday

“On his birthday, everything hit him,” Santiago said.

Ramirez’s widow, Blanca Ramirez, 60, said outside court she was satisfied with the sentence but wasn’t sure she was ready to forgive Gutierrez.

“It’s too soon for me,” she said.

Her husband, she said, was “a very beautiful man.”