EDGECOMBE COUNTY, N.C. — A deputy shot and killed a man who was attacking another officer Thursday afternoon near Tarboro, North Carolina, according to the Edgecombe County Sheriff's Office.

The officer, a corporal with the sheriff's office, was stabbed twice in the back, the sheriff said Friday. The corporal was treated at a hospital and released the same day, according to the sheriff's office.

"This incident took place in under 10 seconds," the sheriff's office said in a press release.

Deputies went to a home in Edgecombe County, just outside of Tarboro, at about 2 p.m. Thursday. A woman said her nephew was "coming at her with a knife," the sheriff's office said.

The deputies met the woman in front of the house. As soon as the woman opened the front door, a 32-year-old man "charged out the door with a large tactical style knife, stabbing the corporal twice in the back," the sheriff's office said. 

Then the man charged another deputy as a third deputy was walking up to the house. 

The deputies shot and killed the man, who has not been named.

"The suspect had a history of mental illness and deputies had been called to this residence for him several times in the past year, as well as to another address for him," the sheriff's office said in a news release. "Sheriff Atkinson notes that we have to do a better job in ensuring there are resources to treat people with serious mental illness locally, and across the state."

The deputies all had body cameras, the sheriff's office said. The sheriff's office said the footage from the cameras has been turned over to the State Bureau of Investigation, which will lead the investigation into the shooting.

"Sheriff Atkinson planned to release the names of the deputies involved in his press conference this morning but was instructed not to by District Attorney Robert Evans. We strive for transparency in incidents and will release all information as soon as we are allowed to," the sheriff's office said.