The march was led by shopkeepers and residents of the city's famous Las Ramblas boulevard, where a van ploughed into pedestrians on Aug. 17, killing 13 and injuring over 100. The crowd applauded representatives of the police and fire services 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.
Members of Spain's Islamic community marched alongside the King and Prime Minister Rajoy, 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.
Some people at the march also took the opportunity to demonstrate against Spain's purchase of weapons.
In addition to the 13 killed in the van attack, 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 organization, and two have been freed on certain conditions.