A photo taken on November 13, 2015 shows vehicles on the M30 speedway as road signs warn of speed limits due to a spike in pollution in Madrid

Madrid city hall on Friday for the first time banned non-residents from parking in the centre of the Spanish capital and reduced speed limits on access highways in an effort to reduce air pollution levels.

The city council, led since June by an alliance of leftist groups, said it decided to apply the restrictions since Friday morning after several days of excess levels of nitrogen dioxide which has left an almost permanent pall of brown fumes hanging over the city.

Parking in the streets of central Madrid was banned for non-residents and the city imposed a speed limit of 70 kilometres (40 miles) per hour on access highways, down from the usual limits of 80-90 kilometres per hour.

The authorities urged residents of the city of 3.1 million people to use public transport.

The measures, decided late on Thursday, sparked criticism, especially from the conservative Popular Party which ruled the city for nearly a quarter century and which governs at the national level.

Deputy Prime Minister Soraya Saenz de Santamaria criticised the "hastiness and lack of preparation with which these measures were adopted."

Madrid Mayor Manuela Carmena, a 71-year-old former judge who vowed during her campaign to take action when air pollution levels rose, said the measures were needed to defend people's health.

"It would be irresponsible on our part to not do anything and allow air to exist which would really be harmful to many people," she said during an interview with public television.

It is not possible to adopt the vehicle restrictions with greater forewarning because levels of nitrogen dioxide can spike at any moment, she added.

"It is not like forecasting the weather, which is much more predictable," the mayor said.

New regulations that came into effect in March mean that high levels of air pollution trigger automatic traffic restrictions in the capital in response to criticism from environmentalists and repeated threats of sanctions from the EU over breaching air safety standards.

The new rules establish warning levels, which if they are sustained, will lead to a progressive implementation of restrictions leading up to a bar on access to some vehicles.

On one day if the higher level of 250 micrograms of nitrogen dioxide per cubic metre of air is reached, or if it is recorded at 200 two days running, warnings will be issued urging drivers to leave their cars at home and speed limits lowered on major road arteries.

If readings remain high the next day, only neighbourhood residents would be allowed to use the parking meters in the centre. Finally, on a third straight day of extreme pollution, vehicles would be cut by 50 percent as odd- or even-number licence plates are banned.

Madrid often gets engulfed in a murky brown cap that can be seen from afar known as "the beret".

The Spanish capital is the sixth most polluted city in Europe, according to a ranking published in 2014 by French environmental organisation Respire.