"Be tough & strong, we love you!" he tweeted.
A van ploughed into pedestrians on Barcelona's busy "Las Ramblas" thoroughfare on Thursday evening, killing at least 13 people and injuring more than 50. Barcelona authorities said they are treating the incident as a terrorist attack.
Secretary of State Rex Tillerson also spoke out on the attack, saying it bears "all the hallmarks of ... yet another terrorist attack".
"We offer our condolences to the loss of life and the injuries that have occurred to so many innocent people yet again," he said.
Mr Tillerson added that the US stands ready to assist law enforcement authorities in Spain, and that US consulates are assisting Americans in the area.
"Terrorists around the world should know that the Untied States and our allies are resolved to find you and bring you to justice," he said.
The United States condemns the terror attack in Barcelona, Spain, and will do whatever is necessary to help. Be tough & strong, we love you!— Donald J. Trump (@realDonaldTrump) August 17, 2017
Eye witnesses reported seeing a white van collide with pedestrians on the street, which is a popular tourist destination. It burst through the crowd at high speed, leaving bodies laying motionless in its wake.
"All of sudden it was real chaos," witness Ethan Spibey told Sky News, "People just started running screaming, there were loud bangs. People just started running into shops, there was a kind of mini-stampede where we were, down one of the alleyways."
One suspect has been arrested and is being treated as a terrorist, the Catalonia police force said. It is unclear how many people were involved. The region's interior minister has called on residents to stay indoors while the investigation continues.
Local authorities said they had found a second van linked to the attack in the small town of Vic. Police have cordoned off the area and are inspecting the vehicle.
The attack mirrors those in London and Paris, where terrorists drove cars through crowded areas with the aim of inflicting mass causalities. Such attacks have killed more than 100 people in Europe since last July.
Just a few days earlier, an American man allegedly drove his car through a crowd of counter-protesters at a white nationalist rally in Virginia, killing one and injuring dozens. Authorities are still determining whether it was a terrorist attack. Mr Trump has been criticised for waiting days to condemn the driver's actions.