The partial lockdown, which will also apply to nine other nearby towns, will come into force at 10:00 pm (2000 GMT) on Friday with people only allowed to leave the city limits for work, school or medical and legal reasons.
Madrid's regional authorities have criticised the restrictions on citizens' movements as too stringent, but for healthcare experts, they simply don't go far enough.
“For all epidemiologists, these restrictions are coming very late, they should have been put in place much earlier, by the start of September,” said Salvador Peiro of FISABIO, a healthcare research organisation in the Valencia area.
Closing off the perimeter was a measure which was “very easy to implement in certain towns but very hard in large cities” such as Madrid, he said, pointing out that hundreds of thousands of people travel every day, often on public transport, to work in nearby towns.
- Random police checks in Spain's capital as Madrid's partial lockdown begins
- ANALYSIS: Why Madrid and not Barcelona is the epicentre of Spain's coronavirus second wave
- LATEST: What you can and can't do under Madrid's new lockdown rules
Fernando Garcia, an epidemiologist at the Madrid public health association, expressed surprise they “did not include a recommendation to work from home” as during the three-month lockdown that started in March.
And he thought the restrictions on seating capacity in bars and restaurants — reduced to 50 percent indoors and 60 percent at terraces — should have been greater.
Others said merely reducing mobility was not enough given the scarcity of track-and-trace resources, with the Madrid authorities urgently requesting military help.
Madrid is currently struggling with an infection rate of 730 cases per 100,000 people, compared with just 300 per 100,000 in the rest of Spain – which in itself is the highest in the European Union.
According to the government decree published on Thursday, restrictions must be imposed on all areas that have counted more than 500 cases per 100,000 inhabitants over the previous 14 days — but experts said the rate should be lower.
A threshold of 500 cases per 100,000 people was far “too high”, said Ildefonso Hernández of the Spanish Public Health Society (Sespas).
In Germany, he said, limitations on social gatherings kicked in with a rate of 35 cases per 100,000.
And in the UK the trigger rate for restrictions was 100 cases per 100,000.
Even within the rest of Spain, limitations have been put in place much earlier in regions like Asturias, Galicia and Valencia, where they kicked in with an incidence of fewer than 100 cases per 100,000 people.
The virus has now killed nearly 32,000 people in Spain according to official figures which only include those who died after testing positive and not the thousands more thought to have perished in care centres and private homes without being tested. It has infected around 760,000.
By AFP's Thomas Perroteau