The city of Madrid is introducing smart parking meters that will slap a surcharge on cars that pollute more and reduce parking charges for efficient vehicles, a system that city officials are touting as the first of its kind in the world.

Starting on 1 July, the price a motorist pays to park in the city streets will be based on a complex table governed by the engine and the year of the car. Hybrids will pay 20% less to park, while a diesel car made in 2001 will see a 20% mark-up. Electronic cars will park for free.

The city is hoping that the new system will help ease pollution levels, which consistently rank above the EU average. The Spanish capital continually exceeds the EU limit for nitrogen dioxide in the air – mainly released through car exhaust systems – with rates that have at times spiked five times above the limit deemed safe by the EU.

Parking fees are one of the best ways to discourage motorists from driving into the packed city centre, said Elisa Barahona, who heads Madrid's sustainability division. "We thought it would be fair if the cars that pollute more pay more, and compensate those who use more efficient vehicles."

The price of parking will also vary depending on how busy the street is: empty streets will cost less to park along, while a street with few remaining parking spots left will charge up to 20% more.

The majority of drivers, said the city, will see little difference in the price of parking, which will range between €0.66 and €3.29 an hour. But an estimated one in four drivers, theoretically those behind the wheels of the most polluting cars in the city, will see the cost of parking rise. "Particularly for those who have cars that pollute, we hope that having to pay more will make people think twice before using them," said Barahona.

The parking meters are part of a wider set of measures designed to improve the city's air quality, she said, including energy efficient buses in the city centre and a bike-sharing programme slated to begin in June. "Now with the economic situation improving a little, we have more opportunities to put all of our ideas in motion."

One million cars enter the city each day, said Mariano González of Ecologists in Action, noting that the new parking meters would help lessen this number. But he highlighted the emphasis the system will place on the age of the car, which plays down the role of other variables. "Maybe you bought a large vehicle this year, say a sports utility vehicle. It could actually have higher emissions than an older, smaller car."

The parking meters, said González, are probably an attempt to appease the European Union, which has threatened the city with hefty fines if it fails to improve its air quality.

He pointed to the London mayor, Boris Johnson, often pictured on his bicycle. In contrast, he said, Esperanza Aguirre, former head of the regional government in Madrid and current president of the Madrid People's party, was recently caught illegally parking her car in a bus lane on one of Madrid's busiest streets as she withdrew money from a cash machine. "It's an image that's quite revealing of the attitude of our politicians towards environmental issues."