Flowers hang at a makeshift memorial for two men who were killed on a commuter train in Portland, Ore., while trying to stop another man from harassing two teenage girls. (Terray Sylvester/Reuters)

— This Pacific Northwest city is often touted as a progressive playground and haven for liberal politics, its history of activism and civil protest a long-held badge of honor. But the past few months have seen Portland turn into a battlefield, where black-clad anarchists and leftist demonstrators collide in the streets with far-right activists, white nationalists and supporters of President Trump.

Over Memorial Day weekend, Portland also became the most recent scene of murderous hate linked to that clash. A 35-year-old man known to yell racial slurs and to thrust his arm in the air to mimic Nazi salutes allegedly harassed two teenage girls, one wearing a hijab, aboard a light-rail train. He then allegedly used a knife to slash three men who came to their aid, killing two of them.

The slayings of Rick Best, 53, and Taliesin Myrddin Namkai-Meche, 23 — whom many hailed as heroes for standing up to the hatred they witnessed — stunned Portlanders. While the city has seen months of demonstrations that have ended with protesters attempting to shut down freeways and bridges, citizens clashing with riot police, the use of rubber bullets and flash grenades, and dozens of arrests, the killings appeared to be something very different.

“There’s an uneasy feeling,” said Peter Simpson, a Portland police spokesman. “It’s something we really haven’t seen here.”

Though Portland has a difficult past containing threads of racism and white supremacy, it has worked to burnish its image as an inclusive, laid-back oasis. Now, Ted Wheeler, Portland’s mayor, has to weigh what many other communities have had to in recent months: how to protect the free exchange of ideas while facing real threats of violence.

It is a consideration that has popped up with increasing frequency in places long considered liberal bastions — such as Berkeley, Calif. — where officials have canceled speeches and events because of fears about physical clashes between fringe groups. The cancellations have in turn spawned protests and criticism about limiting speech.

After the slayings Friday, Wheeler called for federal officials to revoke permits for a planned right-wing rally during the city’s cornerstone Rose Festival because of the expectation that it will turn violent, with protests and counterprotests within a highly charged environment. The Oregon American Civil Liberties Union slammed the decision, saying it amounts to government limiting speech it does not want to hear.

“The situation on the ground in Portland is tense,” Michael Cox, a spokesman for Wheeler, said Tuesday. “The man who is suspected of committing these horrible murders was a known figure at alt-right rallies in our city, and while everybody has the right to free speech here in Portland, we have now experienced what it’s like when free speech crosses over into horrific violence.” The alt-right is a small, far-right movement that seeks a whites-only state.

That man is Jeremy Joseph Christian, who appeared Monday at an arraignment in Portland. As he entered the courtroom, Christian yelled: “Free speech or die! . . . This is America! Get out if you don’t like it!” As he was escorted out, he shouted: “You call it terrorism, I call it patriotism!”

Christian was known to police and to area activist groups, in part because of his recent participation in local protests. On the morning of April 29, as a free-speech protest assembled at a Portland park, Christian appeared with a Revolutionary War-era flag draped over his shoulders. He strolled across the grass while yelling racial slurs.

In an April 29 photo provided by John Rudoff, Jeremy Joseph Christian is seen during a Patriot Prayer organized by a pro-Trump group in Portland, Ore. Police say Christian fatally stabbed two men who tried to shield two teenage girls from an anti-Muslim tirade on a Portland light-rail train on Friday. (John Rudoff/AP)

Joey Gibson, whose Patriot Prayer group organized the April 29 march to bring together Trump supporters and right-wing activists, has traveled with his group to protests in Berkeley and Seattle because “the streets for too long have been run by extreme-left liberals. . . . We’re trying to turn this West Coast so it’s not just blue. I don’t want people to be ashamed to be conservative on the West Coast.”

But Gibson said Christian’s presence at the Portland rally was fearsome; Gibson said he appeared to be attacking pretty much everyone there. As Gibson prepared to take to a microphone on a fenced soccer field in East Portland’s Montavilla Park, Christian began causing a scene, walking up to anti-fascist counterprotesters and screaming at them: “Take your mask off or don’t talk to me! This is my town!” Police surrounded him.

“He was a scary guy,” Gibson said. “We kicked him out. We did the best that we could, but it was a public space. We made it very well known that he’s not with us.”

Hours later, after the march wound its way down a busy street and marchers gathered in a Burger King parking lot, there was Christian again, screaming: “Die Muslims! Die fake Christians!”

Some experts say the current political and cultural climate has left people with extremist ideologies feeling angrier about their positions than in years past, perhaps making them more willing to air them publicly.

Mike German, a fellow at the Brennan Center for Justice at the New York University School of Law, said the presidential campaign and the Trump administration’s embrace of some far-right views have given extremists “a bigger platform.”

But German, a former FBI counterterrorism agent, said that out of those who identify with extremist ideologies, “there is a tiny minority of them that engage in violence” and other crimes.

The violence in Portland followed other fatal hate-related incidents in Florida and Maryland that have sounded similar alarms.

In Tampa on May 19, a former neo-Nazi told police that he killed two of his roommates because they were “disrespecting” his newly chosen Islamic faith; a third roommate who was uninjured had a framed photograph of Oklahoma City bomber Timothy Mc­Veigh in his room along with firearms, ammunition and suspected bomb-making materials. Authorities said the third roommate acknowledged he is a member of Atomwaffen, a neo-Nazi organization that the Anti-Defamation League and Southern Poverty Law Center consider a hate group.

The next day, Sean Christopher Urbanski, a white 22-year-old University of Maryland student, allegedly stabbed to death 23-year-old Richard Collins III, a black man who had just been commissioned in the U.S. Army. Urbanski appeared to have been involved with a social-media group called Alt-Reich: Nation.

The Southern Poverty Law Center said that Christian appears to hold racist, white-supremacist views, reportedly praising Mc­Veigh in a social-media post last month on the anniversary of the 1995 Oklahoma City bombing, calling him a “true patriot.” Other experts said Christian’s views are hard to peg, with some of his social-media posts appearing anti-Christian and pro-Sen. Bernie Sanders (I-Vt.).

As much as the Rose City has protest in its DNA, Portland also has racism in its blood. Portland has been dubbed the whitest city in America, with the 2015 Census showing that 77 percent of the population here was white.

Photographs from the 1920s show city officials posing with hooded Ku Klux Klan members. In 1981, Portland police officers dumped dead opossums on the steps of a black-owned restaurant. In 1988, a carload of skinheads beat an Ethiopian man to death. Black exclusion laws stayed in the Oregon constitution until 2000.

Racism is still on the tip of this city’s tongue. After Portland police shot and killed 17-year-old Quanice Hayes in February — a suspect in an armed robbery who police found was carrying a replica gun — black leaders have railed at city officials. During a two-hour meeting at City Hall last week, Hayes’s family members and other black leaders read speeches, pleading with Wheeler and the city council to address racism.

Portland residents Sedona Soulfire, 41, left, and Kat Ablola, 38, arrange flowers at a makeshift memorial at a train station where two men were killed Friday. (Terray Sylvester/Reuters)

Late afternoon on Memorial Day, people streamed by the Hollywood MAX train station where Best and Namkai-Meche were killed, leaving bouquets of flowers and poems. Some wrote messages in big nubs of blue and pink chalk: “Interrupt hate even if you die,” and “Raise your children to be upstanders, like them.”

Several visitors to the memorial said Portland has been fooled into believing it can be immune to the world’s nastiness. “Life is too easy and too good in Portland — if you’re white,” said Deborah Einbender, 70.

Alison Taylor, 37, pushed a stroller, her 18-month-old son Benjamin toddling over the chalk messages as she read them.

“Portland sometimes feels like a bubble. It’s not,” she said, noting that Portlanders often think of their city as different, special. “Now we’re second-guessing things. Right now . . . there’s tension.”

Bever reported from Washington.