Prime Minister Theresa May said she is "sickened by the senseless loss of life in Barcelona" following Thursday's deadly attack.
Mrs May condemned the "terrible" assault in the Spanish city which saw a van plough into pedestrians and follows similar attacks in London in recent months.
She said: "My thoughts are with the victims of today's terrible attack in Barcelona and the emergency services responding to this ongoing incident.
"The UK stands with Spain against terror."
In a written statement, Mrs May added: "I am sickened by the senseless loss of life in Barcelona today.
"The Foreign Office is working to establish if any British nationals were involved in this appalling incident and we are in close contact with the authorities in Spain, who have our full support.
"Following the attacks in Manchester and London, Spain stood alongside the British people. Tonight, Britain stands with Spain against the evil of terrorism."
Meanwhile, US president Donald Trump wrote on Twitter: "The United States condemns the terror attack in Barcelona, Spain, and will do whatever is necessary to help. Be tough & strong, we love you!"
Sadiq Khan said London stood with Barcelona "against the evil terrorism" following recent attacks in Westminster, London Bridge and Finsbury Park.
Mr Khan wrote on Twitter: "My thoughts are with the victims of this barbaric terrorist attack in the great city of Barcelona and with their brave emergency services.
"London stands with Barcelona against the evil of terrorism."
A number of other high-profile figures also voiced support for the Barcelona victims.
Labour leader Jeremy Corbyn tweeted: "Terrible reports from Barcelona. My thoughts are with those killed and injured, and the emergency services working to save lives."
Foreign Secretary Boris Johnson said: "Concerned and saddened by #Barcelona attack. Our thoughts are with those affected. Doing all we can to identify whether Brits need help."
US First Lady Melania Trump wrote: "Thoughts and prayers to #Barcelona."
Barcelona FC said it was "deeply saddened" by the attack, while their rivals Real Madrid expressed "solidarity with the victims and their families and friends".
Former England striker Gary Lineker, who played for Barcelona for three seasons from 1986-89, tweeted: "Deeply saddened to hear about the attack in the wonderful city of Barcelona. What purpose this barbarity serves is beyond comprehension."
Manchester City manager Pep Guardiola, a former Barcelona midfielder and coach, said: "All at MCFC are saddened to hear of the attack in the City of Barcelona. Our thoughts are with all affected and the emergency services."
Spanish tennis champion Rafael Nadal, whose uncle Miguel Angel Nadal used to play for Barcelona, said: "Shattered by what has happened in Barcelona! All my support for the families affected and the city."
Sue Murphy, deputy leader of Manchester City Council, said: "Our hearts go out to Barcelona in the wake of this sickening incident.
"Manchester stands in solidarity with that great city. We know from recent experience both how devastating this sort of attack is and how important international solidarity, community spirit and a refusal to give in to terror are in dealing with its aftermath."
Former US president Barack Obama tweeted: "Michelle and I are thinking of the victims and their families in Barcelona. Americans will always stand with our Spanish friends. Un abrazo."
Former presidential candidate and first lady Hillary Clinton posted: "Barcelona, you have our resolve and support in the face of this cowardly attack. We stand together against terrorism wherever it strikes."
French President Emmanuel Macron tweeted: "All my thoughts and solidarity from France for the victims of the tragic attack in Barcelona. We will remain united and determined."