SAN FRANCISCO -- A man who allegedly stabbed two elderly women without warning at a San Francisco bus stop was charged with attempted murder in an attack that follows a number of others against Asian Americans nationwide, authorities announced Thursday.

Patrick Thompson, 54, of San Francisco also was charged with assault with a deadly weapon and elder abuse for Tuesday's attack, with sentencing enhancements for great bodily injury, great bodily injury on elders and personal use of a deadly weapon, the district attorney's office said in a statement.

Thompson, who has a history of mental illness, could face a potential life sentence if convicted. He was scheduled to be arraigned on the charges Friday. The San Francisco public defender's office, which is representing Thompson, said it would be able to comment after the arraignment.

A witness told KGO-TV that the man was carrying a large knife with knuckles on the handle and without warning attacked the women as they waited for a bus on Market Street.

"The knife punctured one victim's lungs, requiring extensive surgery," the district attorney's office said. "A knife had to be removed from another victim at the hospital."

Authorities initially said the women were 65 and 84 years old and didn't immediately identify them. But a family member said the elder victim was 85-year-old Chui Fong Eng.

Victoria Eng said her grandmother was stabbed in the right arm and the blade entered her chest. She underwent successful surgery.

"We were able to visit grandma today! It was so emotional walking in and seeing her," Eng posted Thursday on a GoFundMe page that had raised more than $98,000 to cover medical expenses. "The staff have been providing exceptional care to her and extremely supportive to our family. She wants to thank everyone for their generosity and well wishes!"

Some of the fundraiser money raised was offered to the family of the other victim, "but they politely declined," the post said.

Both women were expected to survive, authorities said.

Authorities haven't said whether the women were targeted because of their ethnicity. But the District Attorney's office said prosecutors were working with police to determine whether there was evidence to support hate crime allegations.

Police Chief William Scott initially said the attack appeared to be "totally random."

On Thursday, the FBI's San Francisco office launched a publicity campaign to encourage the victims of hate crimes to come forward. The effort comes amid a wave of attacks against Asian Americans -- many of them elderly -- in San Francisco and across the country.

Thompson has a criminal background that includes assault with a deadly weapon likely to cause great bodily injury, according to KGO-TV.

He was arrested in 2017 and sent to a state mental hospital after being found incompetent to stand trial, the district attorney's office said.

In 2018, Thompson was sent into a state Mental Health Diversion program that provides "intensive, court-monitored treatment and services," the District Attorney's office said.

A judge allowed him to be released from the program after nearly two years. He wasn't charged with any new offences. But he was arrested on warrants for missing court dates, including in April 2020, when he also was found to be in possession of a drug pipe, prosecutors said.

"What happened is a devastating tragedy, and we will use the full force of our office's resources to prosecute this case. We also need to work hard to stop the next crime from happening, and that involves prevention and treatment," the District Attorney's office statement said. "Mr. Thompson needed intensive supervision and services -- which he received during Mental Health Diversion and which prevented new criminal behaviour."

"We also must implement stronger responses to addressing the mental health crisis in our streets in order to keep our community safe," the statement said. "For over 40 years, we have failed to invest resources into treatment, supportive housing, and other necessary services for those who are mentally ill and their families. We are all less safe as a result of that legacy."