People of all ages and ethnicities waved banners which read “we are not afraid” and “the best response is peace”.
The number of people killed in two vehicle attacks in Spain last week rose to 16 on Sunday after a German woman died from her injuries, local authorities in Barcelona have said.
About 500,000 people have marched in Barcelona in a huge public rejection of violence following a recent deadly attack in the Spanish city, chanting: “I’m not afraid.”
In an unprecedented move, King Felipe VI also took part, along with the Spanish Prime Minister and the local mayor.
The marchers carried red, yellow and white flowers — the colours of Barcelona — as they made their way along the city’s main boulevard, the Paseo de Gracia, to the Plaza de Catalunya, near where the attack took place.
Those who helped the victims, including the emergency services, taxi drivers and shopkeepers, were at the head of the march, as the crowds stretched back a mile.
Prime Minister Rajoy had encouraged “everyone” to take part to show that “Catalonia and the rest of Spain [are] united against terror”.
The 17 August attack – which saw a van deliberately driven into people on the Las Ramblas boulevard – was claimed by the Islamic State group.