The court "rejected the ratification (of the measures), because they harmed the fundamental rights and freedoms" of the 4.5 million inhabitants affected by the partial lockdown, which came into force on Friday evening, the court said in a statement.
As a result of the decision, fines cannot be handed out to citizens who break the rules.
The central government — a coalition of the Socialist Party (PSOE) and Unidas Podemos — has locked horns with the conservative-led Madrid regional government over the measures.
The partial lockdown of the city and its suburbs aimed to curb the spread of the coronavirus in Madrid, which is at the epicentre of Europe's second wave of the pandemic.
Comment: Notably it was Madrid's poorest areas targeted by the lockdown decided by central government.
Madrid's regional premier Isabel Díaz Ayuso has previously been unwilling to implement harsher COVID-19 measures arguing they would cause further damage to the economy, but on Thursday she asked inhabitants not to leave the city.
"We once again ask all residents not to leave Madrid and to follow all health recommendations, especially in the coming days with the extended weekend," she said, referring to a national holiday on Monday.
Spain's national government ordered two weeks of new restrictions that started at 10 pm on Friday despite pushback from regional officials.
The measures prohibited all nonessential trips in and out of Madrid and nine of its suburbs — affecting around 4.8 million people.
Restaurants were ordered to close at 11 pm and shops at 10 pm and both were told to limit capacity to 50%.
But Madrid's autonomous authority clashed with Spain's central government over the order, saying it would comply but would simultaneously challenge it in the courts.
The High Court will next rule on whether to suspend the measures as it considers the Madrid government's appeal, having already thrown out an immediate suspension of the restrictions, as requested by the far-right Vox party.
Madrid is leading the resurgence of the virus in Spain, which has Europe's highest cumulative caseload — 870,000 confirmed cases since the onset of the pandemic.
The surge of cases in the Spanish capital has hit hospitals hard, with officials saying that over 40% of the region's ICU capacity is now being used to treat COVID-19 patients.
Comment: Let's hope Madrid is just the beginning, because these same peculiar and tyrannical orders are being enforced by a number of European governments. However, since these governments are clearly acting in an unsually coordinated manner, taking the same actions within days of each other, claiming to be fighting the virus, why is that they're not also sharing with each other the fact that the lockdowns aren't working? Unless this isn't really (only) about stopping a virus anymore? UK gov admits lockdowns aren't working but is mulling HARSHER measures and new lockdowns in northern England anyway