Two men were killed and a third injured in a knife attack after they tried to stop what police are describing as a hate speech incident in Portland, Oregon.

The knife attack happened aboard a commuter train that had pulled into the city’s Hollywood transit station around 4:30 p.m. on Friday. Three people were stabbed as they tried to calm a man who had been harassing two females, one of whom was wearing a hijab, police said.

The attacker began yelling at them to “get out of the country because you don’t pay taxes here,” passenger Evelin Hernandez told the Portland-based ABC-affiliated TV station KATU.

“[He said] he doesn’t like Muslims, they’re criminals,” Hernandez said.

“The suspect was on the train and he was yelling and ranting and raving a lot of different things, including what would be characterized as hate speech or biased language,” Portland police Sgt. Pete Simpson said.

Victims ‘attacked viciously’

“In the midst of his ranting and raving, some people approached him and appeared to try to intervene with his behaviour and some of the people he was yelling at were attacked viciously by the suspect,” Simpson said.

Portland Mayor Ted Wheeler issued a statement saying, “Two men lost their lives and another was injured for doing the right thing, standing up for people they didn’t know against hatred. 

“Their actions were brave and selfless, and should serve as an example and inspiration to us all. They are heroes.”

One man was pronounced dead at the scene and another man was taken to hospital where he was pronounced dead. A third person had non-life threatening injuries.

Simpson told CNN the target of the insults were either girls or young women. He said they left the train before investigators could talk to them.

The attacker also left the MAX light-rail train and was later arrested south of Portland’s Hollywood Transit Centre. 

Police say 35-year-old Jeremy Joseph Christian of Portland is charged with two counts of aggravated murder, two counts of second-degree intimidation and one count each of attempted aggravated murder and being a felon in possession of a restricted firearm.