Madrid's regional government announced on Friday that movement between and within six districts that are home to about 850,000 people will be restricted from Monday, although people will still be able to go to work.
The lockdown measures predominantly apply areas of lower income and with higher immigrant populations. Peaceful protests were held 12 of the 37 districts affected today.
About 600 people demonstrated in the southern district of Vallecas, which has one of the highest infection rates in the Spanish capital, almost six times higher than that of Chamberi, a wealthy area in the north of the city, according to regional government figures.
"We want adequate measures to protect us in these working class areas. We don't have medical centres. Many people do not have a work contract so they can go into quarantine in peace," said Vanesa, a protester, who lives in Vallecas.
Vallecas is not a ghetto, chanted demonstrators.
They also called for the resignation of Madrid regional leader Isabel Diaz Ayuso, who attracted criticism for saying this week "the way of life of immigrants" was partly to blame for the rise in cases.
Madrid mayor Jose Luis Martínez-Almeida said the measures did not discriminate against the poor.
"There are no first class residents and second class residents. We have to be together at this moment," he tweeted.
Authorities in Madrid, which accounts for a third of all infections in Spain, announced the restrictions in areas where the contagion levels exceed 1,000 per 100,000 inhabitants.
Access to parks and public areas will be restricted, gatherings will be limited to six people and commercial establishments will have to close by 10 p.m. in the areas.
Police will be deployed to enforce the lockdown, authorities said on Saturday.
However, Madrid regional health chief Enrique Ruiz Escudero said if these measures did not reduce coronavirus cases, a city-wide lockdown could follow.
"If it is necessary to shut down Madrid, we will do it," he said in an interview with ABC newspaper published on Sunday.
Spain has the highest number of COVID-19 cases in western Europe but Spanish Prime Minister Pedro Sanchez ruled out a second national lockdown in an interview with La Sexta TV on Saturday.
Some 640,040 people have been diagnosed with Covid-19 in Spain, health authorities said on Friday, with a rise of 4,697 in the past 24 hours. Nearly 30,500 people have died. -Reuters