A Bay Shore man admitted in court Wednesday that he stabbed a housemate to death during a drunken argument three years ago.

Edwin Ramirez, 27, pleaded guilty to first-degree manslaughter in the Aug. 8, 2013 killing of Luis Gomez, 22.

In return for the plea in Riverhead, state Supreme Court Justice William Condon promised to sentence Ramirez to the minimum sentence of 5 years in prison.

“The people have a very strong case here,” Condon told Ramirez before he entered his plea. “I believe this is a fair resolution. It is likely going to result in your deportation.”

Ramirez, a native of El Salvador, said through an interpreter that he understood that. Gomez also was from El Salvador.

Assistant District Attorney Kathleen Kearon recommended a prison sentence of 10 years.

Defense attorney Christopher Gioe of Central Islip said his client never intended to kill his housemate, and he’s sorry for it now.

“This was an alcohol-related incident,” Gioe said. “A bunch of guys were drunk and things got out of hand.”

Gomez was stabbed in the chest with a kitchen knife. He had come to the United States to work and provide money for his family in El Salvador, friends and family said at the time.

advertisement | advertise on newsday

Other tenants said then that Ramirez was fighting with another man when Gomez tried to break it up and got stabbed.

Gioe said Ramirez “agrees that this was the proper sentence.”

Condon will sentence Ramirez on Sept. 23.