AMERICANS ARE right to be frightened by the appalling attack at Ohio State University, where a young Somali student rammed his car into a group of people on the sidewalk, then emerged from the driver’s seat to slash some of them with a knife. It was the latest, though hardly the worst, in a string of assaults across the country carried out by Muslims, including citizens, immigrants and, as in this case, a refugee. That is justifiable cause for concern.

Hatred is ecumenical, of course. Muslims have no monopoly on horrific acts of violence, as one is reminded by the trial underway of Dylann Roof, the accused church gunman charged with murdering nine black worshippers in South Carolina last year.

Still, the fact that the Islamic State claimed credit for the OSU attack was seized on by President-elect Donald Trump, who tweeted that the assailant — a Somali-born student who was admitted to the United States as a refugee after spending several years in Pakistan — “should not have been in our country.” On Thursday, he reiterated his threat to “suspend immigration from regions where it cannot be safely processed” and said that programs to admit refugees were created by “our very stupid politicians.”

In fact, the United States has been a beacon for refugees since its founding, and those who have sought and received refuge here include Albert Einstein, Marlene Dietrich, the singer Gloria Estefan, the supermodel Iman, the director Milos Forman and a pair of secretaries of state: Henry Kissinger and Madeleine Albright.

No system can guarantee that every newcomer will be peaceable or impervious to radical ideas. In the case of OSU suspect Abdul Razak Ali Artan, who had no known history of violence or radicalization, it seems unlikely that tighter screening procedures would have blocked him from entering the country in 2014. It is possible, though not certain, that he was inspired by propaganda from Islamic State, which referred to him as a “soldier.” Mr. Artan himself told a student interviewer in the fall that Mr. Trump’s campaign rhetoric made him afraid to practice Islam openly.

It is sensible for immigration officials to scrutinize screening procedures and tighten them. It is fair for law enforcement agencies to scour social media for individuals who may be attracted to radical ideas, or flirting with violence.

But it is irrational to seize on an incident, or a handful of incidents, as justification for barring Muslim refugees, which would be antithetical to America’s prestige and counterproductive in its war on terrorism. Of the nearly 85,000 refugees who entered the United States in the fiscal year that ended in September, nearly half were Muslim. Both the total number of refugees and the Muslim portion were at their highest levels since 2002, when data on refugees’ religious affiliations became publicly available, and they included large numbers from Syria, Iraq, Somalia and Iran, all predominantly Muslim countries.

As they have through history, those refugees will bring an infusion of energy, ambition and economic vitality to American shores. The country should not close its doors to them.