Most petrol and diesel cars have been banned from the heart of Madrid as the city tries to improve the air quality in one of Europe's most polluted capitals.

Key points: The plan has been challenged in court and could be ended before it is fully implemented

The plan has been challenged in court and could be ended before it is fully implemented There are some exemptions like those for residents of the centre, electric or hybrid vehicles and motorcycles

There are some exemptions like those for residents of the centre, electric or hybrid vehicles and motorcycles Police will patrol the area but no fines will be issued during the first few months of the ban

Police patrolled dozens of access points to the almost 5-square-kilometre area of the Spanish capital — including the Gran Via avenue and Puerta del Sol square teeming with tourists — to block all cars except those with exemptions, or that were electric or hybrid powered.

Grinding traffic jams and a lot of older or diesel vehicles, plus a frequently windless dry climate, have contributed to the high levels of nitrogen dioxide in Madrid that have been in violation of European regulations since 2010.

Madrid authorities hope to catch up with other European capitals such as London, Paris, Berlin and Oslo that are already restricting traffic to improve the air quality.

In London, a congestion charge on private vehicles came into effect in 2003. Car use there decreased by nearly 20 per cent from 2000 to 2009.

However, the plan may fall apart before it is fully implemented if the conservative opposition Popular Party, which argues that the administrative procedure of adopting the new rules was flawed, has its way after challenging it in court.

Ines Sabanes, who is in charge of environment and mobility at Madrid City Hall, said the city would press ahead with anti-pollution measures.

"We can't afford it [inversion of environment policies], neither can the cities, nor the health of the planet," she said.

Traffic was heavy on Friday (local time) around the perimeter of the new exclusion zone, with cars honking loudly, but it was little different from any other day as cars without the permits appeared to steer clear of the area.

Critics said the rules had multiple, complex exceptions that could undermine the plan's efficiency.

For instance, residents of the central area can drive any kind of car, including older diesel cars, and so can property owners even if they are not residents. All motorcycles are allowed during the day.

Police will enforce the restrictions for the first few months without applying fines, but in March a computer system is due to fully assume control and fine potential violators.

"I am very happy with these measures because I think they are going to clean the air in the centre of the city," said Adrian Beaton, a student in his 20s, who usually uses public transport to access the area.

Police will enforce the new restrictions but won't issue fines until March. ( AP: Paul White )

ABC/Reuters