From Thursday, cars with even-numbered registration plates will be banned from entering the city.
If this has not cut the pollution levels sufficiently then on Friday cars with odd-numbered registration plates will be banned.
If motorists ignore the ban, which will be in force between 6.30am and 9pm, then they will be fined €90 (around £77).
Madrid authorities have been battling to reduce pollution, which has been made worse by a prolonged period of hot sunny weather pushing the amount of nitrogen oxide above EU risk levels.
They have tried a temporary parking ban in the city centre for non-residents and reducing the speed limit of the capital’s main circular road but pollution has still increased.
Motorists will be informed by midday on Thursday if the Friday plan will come into place – with an odd number ban on one day and an even on the other.
Paz Valiente, a spokesperson for the city council, said: “Every day the city pumps out a great deal of emissions into the atmosphere, but it blows away. The current thermal pressure is impeding that ventilation.”
Madrid is the latest in a line of European cities to impose anti-pollution measures on motorists.
Paris has used the number plate system before. In 2003, London introduced congestion charge, a portion of revenue from which has been reinvested in the city’s public transport infrastructure.