The driver of a truck who mowed down people on a cycle path in Lower Manhattan in New York - killing at least eight people - was an immigrant who settled in Florida in 2010, according to US media reports.
A 29-year-old man who emerged from the vehicle was shot by a police officer and arrested.
US media have reported the suspect was an immigrant who came to the US from Uzbekistan in 2010 and had apparently settled in Florida.
A note was found in the truck that referred to so-called Islamic State, a law enforcement source told CBS News.
New York City Mayor Bill de Blasio said it was "cowardly act of terror aimed at innocent civilians".
He added: "We know that this action was intended to break our spirit. But we also know that New Yorkers are strong, New Yorkers are resilient and our spirit will never be moved by an act of violence and an act meant to intimidate us."
President Donald Trump tweeted: "My thoughts, condolences and prayers to the victims and families of the New York City terrorist attack. God and your country are with you!"
New York Police Department (NYPD) Commissioner James O'Neill said a vehicle rented from retailer Home Depot had struck cyclists and pedestrians while being driven along the cycle path for many blocks, before hitting a school bus and coming to a halt.
The driver emerged holding what appeared to be two handguns and made a statement "consistent with a terror attack" before being shot in the abdomen by a police officer stationed near the scene, he said.
A paintball gun and a pellet gun had been recovered from the scene, the commissioner said
"The dead and injured were just going about their days, heading home from work or from school or enjoying the afternoon sun on their bicycles," he added.
Mangled bicycles littered the scene of the attack, which occurred as the city was celebrating Halloween.
One witness, identified as "Eugene," told ABC Channel 7 that he saw a white pick-up truck driving fast down the cycle path alongside the West Side Highway, near Stuyvesant High School, at full speed and hitting a number of people.
He also reported hearing about nine or 10 shots.
Another witness, who gave his name as "Frank", told local TV network NY1 that he had seen a man running around an intersection and heard five to six gunshots.
"I saw he had something in his hand, but I couldn't tell what it was. But they said that it was a gun ...
"When the cops shot him, everybody started running away and it got a little bit crazy right there. So when I tried to look again, the guy was already down."
President Donald Trump had been briefed on the incident, the White House said. "Our thoughts and prayers are with all those affected," spokeswoman Sarah Sanders said.
Mr Trump tweeted: "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.!"