NEW YORK — A driver plowed a pickup truck down a crowded bike path along the Hudson River in Manhattan on Tuesday, killing eight people and injuring 11 before being shot by a police officer in what officials are calling the deadliest terrorist attack in New York City since Sept. 11.

The rampage ended when the motorist — whom police identified as Sayfullo Saipov, 29 — smashed into a school bus, jumped out of his truck, and ran up and down the highway waving a pellet gun and a paintball gun and shouting “Allahu Akbar,” Arabic for “God is great,” before he was shot in the abdomen by the officer. He remained in critical condition on Tuesday evening.

Mayor Bill de Blasio declared the episode a terrorist attack, and federal authorities were leading the investigation. Investigators discovered handwritten notes in Arabic near the truck that indicated allegiance to the Islamic State group, two law enforcement officials said. But investigators had not uncovered evidence of any direct or enabling ties between Saipov and ISIS and were treating it as a case of an “inspired” attacker, said two counterterrorism officials.

Advertisement

“Based on information we have at this moment,” de Blasio said at a news conference, “this was an act of terror, and a particularly cowardly act of terror aimed at innocent civilians.”

Five of the dead were Argentine tourists in New York for a 30-year high school reunion, said a senior official in Santa Fe province, where they were from. Argentine authorities said they were Hernán Mendoza, Diego Angelini, Alejandro Pagnucco, Ariel Erlij, and Hernán Ferruchi. Martín Ludovico Marro, a sixth member of the group, was wounded. Belgian officials said one of those killed and three of the injured were from Belgium.

Saipov came to the United States from Uzbekistan in 2010 and had a green card that allowed permanent legal residence. He had apparently lived in Paterson, N.J., and Tampa. An official said he rented the truck from a Home Depot in New Jersey.

The truck came crashing to a stop near the corner of Chambers and West streets by Stuyvesant High School. Sirus Minovi, 14, a freshman there who was hanging out with friends, said people scattered.

He realized it was not a joke when he saw the man staggering through the intersection, waving guns and screaming words he could not make out. A passer-by approached the attacker, apparently trying to calm him, Minovi said, until the man realized the attacker had a gun. The man “put his hands up and was backing away,” Minovi said.

Almost immediately, as investigators began to look into Saipov’s history, it became clear the had been on federal authorities’ radar. Three officials said he had come to the federal authorities’ attention as a result of an unrelated investigation, but it was not clear whether that was because he was a friend, an associate, or a family member of someone under scrutiny or because he himself had been the focus of an investigation.

Over the last two years, a terrorism investigation by the FBI, Department of Homeland Security, New York Police Department, and federal prosecutors in Brooklyn resulted in charges against five men from Uzbekistan and one from Kazakhstan for providing material support to ISIS. Several have pleaded guilty. It is unclear whether Saipov was connected with that investigation.

Martin Feely, a spokesman for the New York FBI office, declined to comment on whether Saipov was known to the bureau.

FBI agents were expected to search Saipov’s home in Paterson, N.J., and his car on Tuesday night, a law enforcement official said. A phone recovered at the scene of the attack also would be searched, another official said.

Advertisement

The attack unfolded as schools were letting out on a crisp Halloween afternoon. It ended five blocks north of the World Trade Center. The driver left a roughly mile-long crime scene: a tree-lined bike path strewn with bodies, mangled bicycles and bicycle parts, from wheels twisted like pretzels to a dislodged seat.

Saipov, a slim, bearded man, was seen in videos running through traffic after the attack with the paintball gun in one hand and the pellet gun in the other.

Six people died at the scene; two others died at a hospital, officials said. The authorities credited the officer who shot him with saving lives.

Coming five months after a car rammed into pedestrians in Times Square, killing one, Tuesday’s attack again highlighted the danger of a car attack on busy city streets. The Times Square incident was not a terrorist attack. But both incidents brought to mind the terrorist attack last year in Nice, France, in which a cargo truck killed scores of people celebrating Bastille Day.

Students in Halloween costumes streamed out of nearby schools after lockdowns were lifted and huddled with parents. Their faces, once painted for the holiday, were streaked with tears.

President Trump responded on Twitter: “In NYC, looks like another attack by a very sick and deranged person. Law enforcement is following this closely. NOT IN THE U.S.A.!” Governor Andrew M. Cuomo cautioned at a news conference, “There’s no evidence that suggests a wider plot or a wider scheme.”

In Boston, police said “there is no known threat to the Boston area.” Boston police said the department “remains in close contact with our local and federal law enforcement partners in New York.” The department also reminded officers “to be extra vigilant.”