Hundreds of thousands of people have marched in Barcelona in a show of unity, chanting "I am not afraid", after two Islamist militant attacks last week left 15 dead, including Australian boy Julian Cadman.
The march on Saturday evening was led by shopkeepers and residents of the city's well-known Las Ramblas boulevard, where a van ploughed into pedestrians on August 17, killing 13 and injuring over a hundred.
The crowd applauded representatives of the police, fire services and medical professions who also led the march.
Spain's King Felipe, Prime Minister Mariano Rajoy and the head of Catalonia's regional government Carles Puigdemont, dressed in dark suits, walked in the throng as people cheered and bore red, yellow and white roses - the colours of Spain's second-biggest city.
"We are here to say we're not afraid, we are united and we want peace," said 59-year-old pensioner Victoria Padilla as she marched.
Slogans carried by marchers read "The best answer: peace" and "No to Islamophobia".
Police estimated the march at half a million people.
Members of Spain's Islamic community marched alongside the king and the prime minister, including women wearing hijabs.
Speakers gave readings next to a floral display with the words "Barcelona" and "I am not afraid" in different languages including Arabic.
"We have to know how to speak to each other and understand others. Everyone has to learn how to be more human," said demonstrator Juan Ripoll, 63.
In the run up to the rally, Barcelona mayor Ada Colau called for a massive turnout after what she called a "tough, painful week" which saw two deadly Islamist militant attacks in as many days and an extensive manhunt for those responsible.
In addition to the 13 killed by the van, two others were killed during the driver's getaway and in a separate car and knife attack in the Catalan coastal resort of Cambrils.
Of the 12 suspects linked to the attacks, six were shot dead by police and two died in an explosion before the van rampage. Two are in custody on charges of murder and membership of a terrorist organisation, and two have been freed on certain conditions.