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."

Spain's central, regional and local authorities tried to send an image of unity on Saturday by walking behind emergency workers, taxi drivers, police and ordinary citizens who helped immediately after the attack on August 17 in Barcelona's Las Ramblas boulevard.

In a first for a Spanish monarch, King Felipe VI joined a public demonstration, along with Prime Minister Mariano Rajoy and other Spanish and Catalan regional officials.

The lead marchers carried a street-wide banner with black capital letters reading "No Tinc Por," which means "I'm not afraid" in the local Catalan language.

READ MORE - 'Barbaric act' - World reacts to Barcelona attack

Medical authorities said on Saturday that 22 people wounded in the attacks are still being treated in hospitals. Six of them remain in critical condition.

The Islamic State of Iraq and the Levant (ISIL) group claimed the vehicle attacks in Barcelona and hours later in the coastal town of Cambrils that left 15 dead and more than 120 wounded.

The investigation into the ISIL (also known as ISIS) cell behind the attacks has shown the group planned even more deadly carnage, but accidentally blew up a house in Alcanar where bombs were being built and gas tanks stored.

Eight suspects are dead, two are jailed on preliminary charges, and two more were freed by a judge but will remain under investigation.

In the northeastern town of Ripoll, home for many of the attackers, members of the local Muslim community and other residents gathered on Saturday in a central square to condemn the deadly attacks.

Located at the foothills of the Pyrenees, the town is where most suspects came under the influence of a radical imam, investigators say.