The Uzbek immigrant accused of using a lorry to mow people down along a New York bike path, killing eight, did it in the name of the Islamic State group, police said on Wednesday.
Investigators, meanwhile, were at the hospital bedside of 29-year-old Sayfullo Saipov, working to extract information about the attack on Tuesday afternoon near the World Trade Centre memorial that also left 12 people injured, a law enforcement official said.
The official said Saipov was lucid after surgery for wounds suffered when he was shot by police.
"He did this in the name of Isis," John Miller, deputy police commissioner for intelligence, said at a news conference, citing handwritten notes left by Saipov in his rented Home Depot pickup.
Mr Miller said the notes, written in Arabic, essentially said the Islamic State "would endure forever".
In the past few years, the Islamic State has been exhorting followers to use vehicles or other close-at-hand means of killing people in their home countries.
The UK, France and Germany have seen deadly vehicle attacks in the past year or so.
"It appears that Mr Saipov had been planning this for a number of weeks," Mr Miller said.
"He appears to have followed, almost exactly to a T, the instructions that Isis has put out in its social media channels before with instructions to its followers on how to carry out such an attack."
Mr Miller said Saipov had never been the subject of a New York police investigation but appears to have some links to people who have been investigated.
Governor Andrew Cuomo said the suspect was a "depraved coward" who tried to create terror.
"He was radicalised domestically," he said on CNN.
"It's not the first time. It's a global phenomenon now."
In a number of recent extremist attacks around the world, the assailants were found to have been inspired but not actually directed by the Islamic State, and in some cases never even made contact with the group.
On the morning after the bloodshed, city leaders vowed New York would be not intimidated, and they commended New Yorkers for going ahead with Halloween festivities on Wednesday night.
They also said Sunday's New York City Marathon, with 50,000 participants and some two million spectators anticipated, will go on as scheduled.
"We will not be cowed. We will not be thrown off by anything," the city's mayor Bill de Blasio said.
While the mayor said there have been no credible threats of any additional attacks, police announced the deployment of heavy-weapon teams and other stepped-up security along the marathon route, in the subways and other sites, and New York Police Commissioner James O'Neill urged people to be vigilant and tell police if they see "something that doesn't look right".
In Tuesday's attack, Mr Saipov hurtled down the bike path, running down cyclists and pedestrians, then crashed into a school bus, authorities said.
He was shot in the abdomen after he jumped out of the vehicle brandishing air guns and yelling "God is great!" in Arabic, they said.
Mr De Blasio called it "a cowardly act of terror".
The dead consisted of five people from Argentina, one from Germany, and two Americans, authorities said.
Nine people remained in hospital in serious or critical condition, with injuries that included lost limbs and head, chest and neck wounds.
A two-mile stretch of road in lower Manhattan was shut down for the investigation.
Authorities also converged on a New Jersey apartment building and a van in a car park at a New Jersey Home Depot.
President Donald Trump railed against the Islamic State on Twitter and declared "Enough!" and "Not in the U.S.A.!"
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.!— Donald J. Trump (@realDonaldTrump) October 31, 2017
On Wednesday, the president took a swipe at the Senate's top Democrat, saying Saipov came to the US under a visa lottery programme,"a Chuck Schumer beauty".
The terrorist came into our country through what is called the "Diversity Visa Lottery Program," a Chuck Schumer beauty. I want merit based.— Donald J. Trump (@realDonaldTrump) November 1, 2017
Mr Trump urged tougher immigration measures based on merit.
Mr Schumer, who represents New York, said in a statement that he has always believed that immigration "is good for America".
New Yorkers woke to a heavy police presence Wednesday outside the World Trade Centre and at other locations around the city.
The slight, bearded Saipov is from heavily Muslim Uzbekistan and came to the US legally in 2010, police said.
He has a Florida driver's license but was apparently living in New Jersey, they said.
Records show Saipov was a commercial lorry driver who formed a pair of businesses in Ohio. He had also driven for Uber.
Mirrakhmat Muminov, 38, of Stow, Ohio, said he knew Saipov because they were both Uzbek lorry drivers.
He portrayed Saipov as an argumentative young man whose work was falling apart and who "was not happy with his life".