The suspect who allegedly stabbed two men on the Upper West Side was at least partially motivated by hate, according to police.

Raul Morales, 51, allegedly yelled the Arabic phrase “Allahu Akbar” as he attacked the two victims near Central Park, witnesses told the police department. On Friday, police said he faced hate crime charges for one of the attacks.

The first victim, a 57-year-old Asian man, was walking near West 84th Street and Central Park West just after 1:30 p.m. Thursday when a man came up from behind him and stabbed him in the back without warning, police said. Minutes later, the suspect stabbed a 50-year-old Jewish man in the chest on the sidewalk of West 86th Street and Amsterdam Avenue.

It was for the latter attack that Morales was charged Friday with attempted murder as a hate crime and assault as a hate crime, police said, as well as first-degree assault. For the attack on the first victim, police said Morales was charged with attempted murder and assault. He also faces weapon possession charges in connection with both alleged attacks.

The stabbings happened about two blocks apart in broad daylight, police said. Both victims were taken to a hospital and were expected to survive. One of the victims was discharged from Mount Sinai Morningside late Friday afternoon.

The department had been working since Thursday to determine a motive. There wasn’t immediately any known link between Morales and the victims, and the initial investigation suggested that mental health may have been a factor in the attacks, NYPD Commissioner Jessica Tisch said.

Morales remained in police custody Friday. It wasn’t immediately clear whether he had an attorney who could speak on his behalf.

Hate crimes in New York City have been on the rise in recent years, while overall violent crime rates have dropped, according to police data. Tisch said in April that more than half of all confirmed hate crimes in the city so far this year targeted Jewish people.

New York City Mayor Zohran Mamdani called the stabbings “horrifying” and praised the NYPD for their quick response to the scene, adding that “these hateful and despicable attacks have no place in our city.”

Gov. Kathy Hochul posted on X she was “disgusted” by what she called “another senseless attack on New Yorkers simply because they’re Jewish.” Ninety minutes later, she added that “Asian New Yorkers, like Jewish New Yorkers, have endured waves of hate-fueled violence in recent years.”

New York City Council Speaker Julie Menin said in a post she was “sickened and furious” by the incident.