PORTLAND, Ore. — An Oregon man charged with murdering two people who had tried to intercede during the man’s anti-Muslim tirade spoke out at an arraignment on Tuesday, calling for “death to the enemies of America” while apparently defending his actions as a form of “patriotism.”

The man, Jeremy Joseph Christian, 35, of North Portland, Ore., is accused of fatally stabbing two men and injuring a third on Friday evening while inside a train car on Portland’s light-rail system.

On Tuesday, Mr. Christian appeared in court here at the Multnomah County Justice Center and was arraigned on nine charges, including two counts of aggravated murder.

As soon as he stepped into the courtroom, he launched into a rant.

“Free speech or die, Portland,” he shouted. “You got no safe place. This is America, get out if you don’t like free speech.”

Mr. Christian stood silently while the judge spoke. Then he consulted briefly with his court-appointed lawyer.

Before leaving the courtroom, he shouted: “Death to the enemies of America. Leave this country if you hate our freedom.

On Monday, Mayor Ted Wheeler of Portland, a Democrat, reacted to the killings by saying that the city would not issue permits for what he called “alt-right” events scheduled for June 4 and June 10. He also called on the federal government to revoke any permits it had already issued. The term alt-right typically refers to a far-right, white nationalist movement.

He also called on organizers of the events to cancel them.

“Our city is in mourning, our community’s anger is very real and the timing and subject of these events can only exacerbate what is already a very difficult situation,” he said. “ There is never a place for bigotry or hated in our community, and especially not right now.”

The mayor’s request comes amid a national debate about free speech that has created a deep schism mostly along partisan lines. The University of California, Berkeley took heavy criticism from both liberals and conservatives when school officials decided to cancel a planned speech by right-wing firebrand Ann Coulter. And similar controversies have arisen on other college campuses across the nation.

After Mr. Christian’s brief arraignment on Tuesday, a group of people outside the courtroom could be heard shouting at him through the doors as he was led away. Members of the news media were prohibited from leaving the courtroom for the next several minutes until the situation de-escalated.

The surviving victim of the attack, Micah David-Cole Fletcher, attended the arraignment.

Ricky John Best, 53, was killed in the train car when he tried to intervene. Taliesin Myrddin Namkai Meche, 23, died at a Portland hospital.

Mr. Fletcher, 21, was hospitalized for serious injuries over the weekend, but told a local television station on Tuesday that he was healing.

Civil-rights advocates have said Mr. Christian has a history of making extremist statements on social media.

Friday’s episode on the light rail unfolded around 5 p.m. when the police said Mr. Christian began ranting and talking disparagingly about two women; one was wearing a hijab.

When the men tried to intervene, Mr. Christian pulled out a knife and slashed them, the police said. The attacker fled the train car but was soon arrested and booked into the Multnomah County Jail.

The two women, who were not injured, left the scene and were later identified and contacted by investigators.

In court documents released Tuesday, prosecutors said video feeds in the back of a patrol car captured Mr. Christian confessing that he had stabbed people in the neck.

The documents also mentioned a fourth man who was the first to intervene and was not attacked.

The district attorney will soon present the case to a grand jury, a spokesman for Metropolitan Public Defender Services in Portland said in an email on Tuesday.

Phoebe Flanigan reported from Portland, and Matt Stevens from New York.

A version of this article appears in print on , on Page A15 of the New York edition with the headline: In Portland Courtroom, A Suspect Still Ranting. Order Reprints | Today’s Paper | Subscribe