MOCKSVILLE, N.C. -- Davie County Sheriff Andy Stokes says he accidentally shot one of his deputies Wednesday night as they were responding to a hostage situation.

Stokes spoke about the incident Thursday afternoon during a news conference. He said he believes the incident was part of an ambush on his deputies.

He said the incident began Wednesday night after deputies tried to serve a warrant to Nicholas Scott Tilley. He was wanted for Armed Robbery, Kidnapping, Burglary, and Assault with a Deadly Weapon Inflicting Serious Injury.

The suspect ran off to a house on South Angell Road with two hostages inside. At the time he began calling his probation officer and said he would not go to prison. But he also told the officer he "would shoot police officers and kill people."

After negotiations with authorities, Tilley released the hostages unharmed.

Chief Deputy JD Hartman said, "Finally the two hostages were released, officers could see the suspect and attempted to take him into custody when he opened fire on the officers."

Deputy Fleming, Hartman, one other deputy, and the K-9 had gone in the home just before Fleming was shot.

Stokes stated Tilley shot the K9 three times.

Stokes said he accidentally shot Fleming while taking cover fire. Investigators did not realize Stokes shot the deputy until Thursday.

"Eventually the suspect came out after an additional stand off with him," Hartman said.

"He came out and surrendered. He is in the Davie County Jail."

During the news conference, Stokes said he fired his gun through a window. A ricocheted bullet hit Fleming.

The K-9, Gorky, died from the gunshot wounds around 1 am Thursday. Gorky was 5-years-old and had worked for the department for 4 years. Authorities said it was shot 3-times, slipped into a coma and died.

Investigators told WFMY News 2's Liz Crawford that Fleming was taken to Wake Forest Baptist Medical Center in Winston-Salem and is in stable condition. The Davie County Sheriff was at the hospital with him on Wednesday night. Fleming was still recovering on Thursday evening.