A Pittsburgh man Monday pleaded guilty to voluntary manslaughter for fatally stabbing his roommate after a New Year’s Eve drinking session escalated into a fight.

Allegheny County Common Pleas Judge Thomas Flaherty sentenced Martin Lopez Hernandez, 33, of East Allegheny, to time already served in the Allegheny County Jail — 295 days — in the killing of Luis Soto, 35.

Hernandez will remain in jail until he is deported back to Mexico, Flaherty told TribLive.

Hernandez and Luis Soto were drinking alcohol with several friends in the basement of their North Side home on Dec. 31, a criminal complaint said.

Two of Hernandez’s roommates — Soto and his brother, Andreas Soto — began arguing around 7 p.m., the complaint said. The dispute got physical, and Hernandez tried to intervene. Luis Soto then punched Hernandez in the nose.

Hernandez, who spoke to Pittsburgh police through a Spanish translator, said that he used a folding, 4- to 6-inch “sheet-rock blade” to defend himself from Luis Soto, the complaint said.

When Luis Soto began to punch Hernandez, Hernandez told police he “jabbed” with the knife and slashed Soto across the abdomen, the complaint said. He then dropped the knife and ran out of the house, according to the complaint.

When Pittsburgh police responded to the Suismon Street home around 9 p.m., they found Luis Soto, lying face up in the basement and suffering from “multiple puncture and slash wounds,” the complaint said.

Pittsburgh police arrested Hernandez on Jan. 1. He has been held, without bond, in the Allegheny County Jail since then.

The Allegheny County Public Defenders’ Office, which represented Hernandez, declined comment Monday.

U.S. Citizenship and Immigration Services did not respond Monday to email or phone calls seeking comment.