Many in the crowd assembled in Madrid's Plaza de Colon waved the national flag and chanted slogans in support of Spain's security forces along with calling for the Socialist prime minister's resignation.
The conservative opposition Popular Party and the center-right Citizens party organized the rally, which the upstart far-right Vox party and other far-right parties backed.
"The time of Sanchez's government is over," Popular Party president Pablo Casado said. He asked voters to punish Sanchez's Socialists in the European, local and regional elections in May.
The political tensions come as a highly sensitive trial at Spain's Supreme Court starts Tuesday for 12 Catalan separatists who face charges, including rebellion, for their roles in a failed secession attempt in 2017.
- Far-right party shakes up Spanish politics
- Is Spain really ready to become a haven for people with Jewish roots?
- Spanish sports minister apologizes to Israeli counterpart over cancellation of match
Sanchez inherited the Catalan conflict 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 northeastern region's voters.
>> Opinion: Stop comparing Catalonia to Palestine
Speaking at a Socialist party event in northern Spain, Sanchez reminded his political opponents that when he was an opposition leader, he stood by Rajoy on the situation in Catalonia even after separatist regional officials staged an October 2017 independence referendum in defiance of Spanish courts.
"And what I am doing now as prime minister, always respecting the constitution, is to solve a national crisis to which the Popular Party has contributed," Sanchez said.
"The unity of Spain means uniting Spaniards and not confronting them as the right wing is doing in Plaza de Colon today," he said.
Sanchez came to power in June promising to thaw tensions between central authorities in Madrid and the Catalan leaders in Barcelona. He met twice with Catalan chief Quim Torra. Members of the central and regional governments had several more encounters.
Sanchez had said he would be willing to help Catalan lawmakers agree to a new Charter Law, which determines the amount of self-rule the region enjoys. But Sanchez's government broke off negotiations on Friday, when Vice President Carmen Calvo said the separatists wouldn't budge from their demand for an independence referendum.
Sanchez is trying to cobble together support to pass a national budget. His minority government will need votes from the Catalan separatists and other parties to pass it.
Even though Sanchez has said he wants to see out the legislative term through 2020, a failure to win a budget vote will crank up the pressure on him to call for an early election.