Thirteen people were also injured in the attack Tuesday when a man is alleged to have intentionally driven a truck onto a bike and pedestrian path in lower Manhattan.
And about six hours after the attack, the president tweeted that he "ordered Homeland Security to step up our already Extreme Vetting Program. Being politically correct is fine, but not for this!"
Trump's began tweeting about the attack in the afternoon, writing, "In NYC, looks like another attack by a very sick and deranged person," Trump wrote on Twitter. "Law enforcement is following this closely. NOT IN THE U.S.A.!"
The attack took place on a bike path on Manhattan's West Side just after 3 p.m. The suspect, Sayfullo Saipov, 29, of Tampa, Florida, was taken into custody. New York City Mayor Bill de Blasio declared the incident a "cowardly act of terror" at a press conference.
The president later posted another tweet to offer his "thoughts, condolences and prayers to the victims and families" affected by the attack. "God and your country are with you!" he said.
The president also tweeted: "We must not allow ISIS to return, or enter, our country after defeating them in the Middle East and elsewhere. Enough!"
The White House later released an official statement from the president on the attack.
"Our thoughts and prayers are with the victims of today’s terrorist attack in New York City and their families. My administration will provide its full support to the New York City Police Department, including through a joint investigation with the Federal Bureau of Investigation," the statement said. "We offer our thanks to the first responders who stopped the suspect and rendered immediate aid to the victims of this cowardly attack. These brave men and women embody the true American spirit of resilience and courage. I will continue to follow developments closely."
Shortly after Trump's first tweet, Vice President Mike Pence added that he was "saddened by the tragedy in NYC" and that "those responsible must be held accountable."
First lady Melania Trump tweeted, "My heart breaks for #NYC today. Thoughts & prayers as we monitor the situation."
Former New York Sen. Hillary Clinton tweeted, "New York's resilience is stronger than a cowardly act of terror. Thinking of the victims, their families, & the responders who saved lives."
Sen John Neely Kennedy, R-La., praised police officers for their swift response to the attack in comments made to reporters at the Capitol.
“I know law enforcement is concentrating on it. But I don’t know how you stop something like that,” Kennedy said in a speech on the senate floor. “You can’t assign a police officer to every American.”
“There just a lot of people in the world who are bad. I wish that weren’t the case,” he added. “They’re not shocked. They’re not confused. They’re not mixed up. They’re just plain damn bad.”
Sen. Elizabeth Warren, D-Mass., said she was keeping the victims and first responders in her thoughts.
Sen. Marco Rubio, R-Fla., said his “thoughts and prayer are with the victims in New York.”
Sen. Kamala Harris, D-Calif., celebrated the NYPD and first responders for their “quick actions.”
Sen. Bob Corker, R-Tenn., sent prayers and condolences to those impacted by the "tragic" attack.