President Michael D Higgins has offered the sympathy and solidarity of Ireland to the people of Spain following a terrorist attack in Barcelona.

President Higgins said that he has asked the Spanish Ambassador to convey his condolences to the Government and people of Spain and to the Mayor of Barcelona.

In a statement, he said: "Barcelona has a long history of hospitality and has over the years received so many people from around the world.

"As President of Ireland I want to send the people of this great and welcoming city not only our sympathy but also the solidarity of the people of Ireland."

Taoiseach Leo Varadkar extended his sympathy on behalf of the Government and the Irish people to Prime Minister Mariano Rajoy and the people of Barcelona and Spain "following this callous act".

In a statement he said: "An attack of this nature, targeting the people of Barcelona and visitors enjoying that wonderful city in the height of the tourist season, is both wanton and cowardly and has no place in our society.

"At this time of immense grief, I want to offer our solidarity and support to the people of Spain, with whom we have such close relations."

President Donald Trump has said that the United States will do whatever is necessary to help Spain in the wake of the deadly attack on Las Ramblas.

The head of the Spanish region of Catalonia, Carles Puigdemont, has said 12 people have died and at least 80 people had been taken to hospital. 

Two men have been arrested.

In a tweet, Mr Trump said that the US condemns the attack.

Earlier, US Secretary of State Rex Tillerson said that the US offered its assistance to Spain and consular assistance was being provided to Americans in the city. He also urged US nationals to check in with their families.

"Terrorists around the world should know - the United States and our allies are resolved to find you and bring you to justice," Mr Tillerson told a press conference with Defense Secretary Jim Mattis and their Japanese counterparts.

A Vatican spokesman said Pope Francis was praying for the victims and wanted to express his closeness to all Spanish people, especially the victims and their families. 

Reacting to the attack, British Prime Minister Theresa May said her thoughts are with the victims of the "terrible attack," and that the United Kingdom stands with Spain against terror. 

Mayor of London Sadiq Khan tweeted: "My thoughts are with the victims of this barbaric terrorist attack in the great city of Barcelona and with their brave emergency services."

Mr Khan added: "London stands with Barcelona against the evil of terrorism."

Japan's Foreign Minister also added his condemnation of the attack and expressed solidarity with Spain.

The office of German Chancellor Angela Merkel  condemned the "revolting attack" in Barcelona.

"We are thinking with profound sadness of the victims of the revolting attack in Barcelona - with solidarity and friendship alongside the Spanish people," tweeted spokesman Steffen Seibert.

French President Emmanuel Macron also voiced solidarity with Spain.

"We remain united and determined," Macron said on Twitter, describing it as a "tragic attack" and saying his thoughts were with the victims.