The Chester County District Attorney's office said on Thursday that the shooting of a knife-wielding man by a sheriff's deputy inside the Justice Center was justified.

Curtis Smith, 34, died after the shooting on Tuesday.

Investigators also said that another deputy, who was injured in the shooting, was accidentally shot in the hand by his fellow deputy during the chaos.

In a news release issued Thursday, District Attorney Tom Hogan said that Smith had been with family members earlier in the day and seemed "normal."

However, for an unknown reason, Smith sped away from the house in his car.

Smith then arrived at the Justice Center, the D.A. said, and entered the front doors at 11:49 a.m.

He was confronted by two deputies, and Smith allegedly said "Let's do this s---!"

That's when he pulled a knife and slashed the first deputy, but the knife was stopped by his bulletproof vest. The second deputy fired three times, hitting Smith twice in the torso.

During the gunfire, police say one of the bullets hit the first deputy in the hand. He underwent surgery for his injuries and is in stable condition.

Smith was rushed to the hospital and was able to tell authorities his name. He later died.

The knife Smith used was recovered.

Neither of the deputies had any previous contact with Smith, the D.A. said, saying the attack appears to have been at random.

The deputy who was injured, Kevin Brough, said in a statement "My fellow Deputy Sheriff not only saved my life in this tragic event, but also potentially the lives of many other citizens who were in the Justice Center."

"I consider my colleague to be a hero for the actions he took and the people he protected."

Smith had been arrested back in March for jumping a fence at the White House. He was arrested by the Secret Service but later released. A court hearing had been scheduled for October.

One of his family members said it was his belief that Smith was attempting "suicide by cop."

Smith has also experience domestic issues, the D.A. said, and his wife had filed a Protection from Abuse Order.