A Pennsylvania man who was arrested for climbing a White House fence back in March was fatally shot Tuesday inside a Philadelphia-area courthouse after he attacked a sheriff's deputy with a knife.

The incident occurred when 34-year-old Curtis Smith entered the lobby of the Chester County Justice Center in West Chester around 11 a.m. and sliced a sheriff's deputy on the arm and hand, said Chester County District Attorney Thomas Hogan, according to USA Today. In response, another deputy opened fire and shot Smith at the suburban Pennsylvania courthouse. Smith was pronounced dead at Paoli Hospital. It was not clear why he was at the courthouse or what prompted the attack.

"The armed attacker was immediately neutralized by the sheriff's deputies," Hogan said in a statement, reports Reuters.

Deputy Kevin Brough was transported to a local hospital to be treated for a cut on his left hand and arm. He has been listed in stable condition, but was scheduled for surgery Tuesday night at the Hospital of the University of Pennsylvania, said Sheriff Carolyn Bunny Welsh, the Philadelphia Inquirer reported.

Following the incident, the courthouse was evacuated and closed for the rest of the day.

"Unfortunately, because of incidents like this across the nation, we have learned how to deal with an attack at a courthouse," Hogan said. "No one else was injured. The sheriffs did their job, and the lockdown went perfectly."

In his statement, Hogan also said that "Smith was arrested by the Secret Service in March for jumping the fence at the White House."

Smith, from Coatesville, was arrested on March 1, after he climbed a stone wall at the southeast corner of the White House complex.

Smith's criminal history also includes arrests for assault and burglary. His, lawyer in a pending domestic-violence case, however, told WCAU-TV his client "had no terrorist claim or anything like that."