IN LOWER MANHATTAN on Tuesday, not far from the memorial to the 9/11 attack on the World Trade Center, eight people were killed and 12 injured when a man espousing fidelity to the Islamic State drove a rented pickup down a busy bike path along the Hudson River. "It was gruesome. It was grisly. It was surreal," one witness said of bicyclists and pedestrians being mowed down. The attack on innocent people enjoying a fine autumn day was a chilling reminder of the persistent threat posed to the United States by Islamist extremists — and their ingenuity in finding ways to commit murder.

Some small comfort can be taken in the fact that in the 16 years since the fall of the twin towers, improvements in protecting the homeland and fighting terrorism abroad have lessened the terrorists' strength to strike and improved our ability to respond. The quick actions of police and other first responders during Tuesday's tragedy should be applauded. So must the resilience and strength of the people of New York City, who made clear they will not be cowed by fear.

Far less inspiring — indeed, downright dispiriting — was the reaction of President Trump. In a series of tweets that apparently were informed (a word we use loosely) by his viewing of "Fox & Friends," Mr. Trump went on a harangue about immigration and attacked Senate Minority Leader Charles E. Schumer (D-N.Y.). On Wednesday, Mr. Trump signaled he might upend the judicial process by declaring the suspected attacker an enemy combatant to be shipped off to the Guantanamo Bay prison; federal terrorism charges filed against him later in the day likely would foreclose that from happening. Note that the White House wouldn't discuss gun control after last month's mass shooting in Las Vegas, on the grounds that it would politicize a tragedy, but it had no problem launching partisan attacks following a terrorist strike that ought to unify all Americans. Note also, as The Post's Philip Bump pointed out, that Mr. Trump is quick to jump to conclusions when there are incidents involving immigrants but is far more circumspect when nonimmigrants are involved.

What's really needed from the Trump administration is not blame-shifting but a serious attempt to investigate and learn from this latest attack. Were others involved or aware of the alleged plans dating back a year that went into the attack? Are authorities right in their initial assessment that the suspect became "radicalized domestically" while living in the United States? Were signals missed when he appeared on the radar of law enforcement in connection with the investigations of other suspects? The 29-year-old, authorities said, allegedly "followed almost exactly to a T" instructions that the Islamic State has put out on its social-media channels on how to carry out attacks. So what can be done to detect and deter other would-be followers?

Among those killed Tuesday were five Argentines who were part of a group of school friends who traveled to New York to celebrate the 30th anniversary of their high school graduation. It was their dream trip to a city known for being open and generous and diverse. Those are the traits that make America great; to undermine them in response to Tuesday's attack only plays into the hands of terrorists.