Police on Long Island, New York, have identified a man who stabbed two officers before being killed by police as a 56-year ex-con who once served two years in prison for assaulting another law enforcement officer.

Suffolk County police on Thursday night said the man who attacked the officers in Medford on Wednesday was Enrique Lopez.

Earlier Thursday, Police Commissioner Rodney Harrison released other details of the deadly encounter during a news conference outside Stony Brook University Hospital, where the officers continued to be treated.

NEW YORK POLICE OFFICERS STABBED, SUSPECT SHOT AND KILLED

Both officers are recovering from wounds that are not life-threatening. One of them was on a ventilator, but in stable condition, Harrison said. Their names have not been released.

"By the grace of God, these officers will be going home to their loved ones," Harrison said.

NYC, Washington Heights, Queens, Long Island

Enrique Lopez, 56, was identified as the man shot and killed by Long Island, New York, police after stabbing two officers. Lopez previously served prison time for assaulting an officer. (Fox News)

The officers responded to a 911 call about a man threatening residents at a condominium complex with a fire extinguisher, police said. When they approached Lopez, he pulled out a large knife, Harrison said.

The officers ordered Lopez to drop the knife, but he lunged at them and stabbed them, Harrison said. One officer was stabbed in his clavicle, neck and groin area, and the other was stabbed in his chest through his bulletproof vest, the commissioner said. A third officer was treated at a hospital for tinnitus, or ringing in the ears, and discharged, officials said.

NEW YORK CITY POLICE SEEKING SUSPECT WHO STABBED, ROBBED SUBWAY RIDER ON TRAIN

One of the officers fired four shots at Lopez, striking him in the upper chest, Harrison said.

County police earlier Thursday told The Associated Press that one of the officers who was stabbed shot Lopez, but later said they were mistaken and could not confirm which officer opened fire. The state attorney general's office is reviewing the shooting under normal procedures.

The officers who were stabbed are both in their 20s with less than five years on the force.

CLICK HERE TO GET THE FOX NEWS APP

Lopez had served two years in prison for assaulting a police officer in 2011, police said.