The also chanted slogans in support of the nation's security forces.
Speaking at a rally organised by his Socialist Party, Sanchez said he respected the demonstrators' right to protest but accused the the conservative opposition Popular Party and the centre-right Citizens party, which organised the rally, of creating divisions in the country.
The protest took place ahead of a highly sensitive trial at Spain's Supreme Court for 12 Catalan separatists, which gets underway on Tuesday.
The separatists face charges, including rebellion, for their roles in a failed secession attempt in 2017.
Sanchez inherited the Catalan crisis from former Prime Minister Mariano Rajoy, the then-leader of the Popular Party.
Rajoy proved incapable of stopping support for secession from swelling in Catalonia to roughly half of the region's voters.
Also read- Pak needs 'painful' economic reforms: Imran Khan
(With inputs from APTN)