(Reuters) - A knife-wielding man was shot by police after stabbing six people at a mental health clinic outside of Pittsburgh, Pennsylvania on Friday afternoon, authorities said.

Dustin Johnson, 38, is accused of starting the attack shortly after entering the Turtle Creek Valley Mental Health center in Homestead around 2 p.m. local time (1900 GMT), the Allegheny County Police Department said.

Police said Johnson went to the fifth floor of the facility where he stabbed the victims, while armed with two knives as well as what appeared to be a handgun but was later determined to be a BB gun.

Johnson stabbed two residents and three employees, local media reported. One of the residents was in a critical condition while the rest of the victims were stable, WPXI.com reported.

Police said SWAT officers were attempting to negotiate with Johnson when the victims and their relatives began calling 911, saying they were bleeding out from their wounds. Three officers subsequently opened fire on Johnson, police said.

Police said Johnson was taken to an area hospital and was undergoing surgery.

Local broadcaster WTAE interviewed staff member CJ Fulton who witnessed the incident and said Johnson was a former patient.

Fulton said Johnson "was angry from something that happened when he was staying there with us, when he was a patient, and he started saying, 'You ruined my life,'" before launching into his stabbing spree.

(Reporting by Curtis Skinner in San Francisco and Brendan O'Brien in Milwaukee; Editing by Lisa Shumaker)