Hamburg is about to become the first city in Europe to implement a partial ban on diesel vehicles to cut pollution.

Officials said they would begin banning older diesel cars and trucks from a main road in the center of Germany's second biggest city starting on May 31. Another key road in Hamburg will also be off limits to older diesel trucks.

Germany has been under rising pressure from residents to improve urban air quality since Volkswagen (VLKAY) admitted rigging diesel engine emissions tests in 2015. But the country's powerful car industry lobbied hard against outright bans.

Dozens of German cities frequently exceed air pollution limits set by the European Union, and in February the country's top court ruled that they could ban diesel vehicles.

Hamburg has installed roughly 100 signs to alert drivers to the new rules and offer alternative routes. A city spokesperson was not immediately available to clarify if local residents would be exempt from the diesel ban.

Data from the European Automobile Manufacturers Association show that nearly one-third of cars in Germany -- or about 15 million -- are powered by diesel. Most diesel cars sold before 2016 would be covered by Hamburg's limited ban.

The city is also introducing other measures to improve air quality. It's encouraging more cycling and installing hundreds of charging points for electric cars, among other things.

The European Commission announced this month it would take Germany to Europe's top court for failing to respect air quality rules, along with five other nations.

Critics have accused the German government of dragging its feet in setting effective air pollution rules due to concerns that this would hurt the country's automakers.

"Now is really the time for [Chancellor Angela] Merkel and her government to really take the lead and start acting on pollution," said Ugo Taddei, an environmental lawyer who has campaigned to ban diesel cars.

Related: Are electric cars more likely to catch fire?

Automakers including Volkswagen, BMW (BMWYY) and Daimler (DDAIF) have been bracing for new restrictions on diesel vehicles amid rising public concern over the health problems caused by their nitrogen oxide emissions.

Volkswagen warned in February that diesel bans by city authorities could "produce a regulatory hotchpotch in Germany, which is unsettling for millions of motorists."

Related: Volkswagen's new CEO is called 'the cost killer'

Vehicles produce around 40% of nitrogen oxide emissions in the EU, and diesels account for most of those.

The European Commission estimates that over 400,000 people die prematurely each year because of air pollution and nitrogen oxide emissions in the EU.

Diesel generates far more harmful air pollutants than gasoline, yet the fuel was promoted by governments in Europe for decades in the hope of reducing carbon dioxide emissions. (Diesel engines are more fuel efficient.)

Sales of diesel cars are now plunging. Just 44% of all new cars sold in Western Europe last year were diesel powered, down from 56% in 2011.

-- Nadine Schmidt in Berlin contributed reporting.