The move makes it the first German city to introduce such a ruling – the measure will come into force on the 31st of May and will affect relatively small sections of road in the district of Altona-North.
It will affect all diesel cars up to and including the ‘Euro 5’ emissions standard.
The first off-limits area will be a 580-metre stretch of Max-Brauer-Allee and will affect both diesel cars and trucks.
The second involves 1.7-kilometre of Stresemannstrasse and will affect only older and larger vehicles.
Exceptions will be made for residents and their visitors, as well as ambulances, taxis, bin lorries and delivery trucks.
Around 168,000 passenger cars across the city are expected to be affected by the ban.
Germany is considering making all public transport free in cities to improve air quality.
The European Commission is taking the country to court for failing to tackle illegal levels of air pollution.