LONDON — Britain will ban the sale of new cars and vans using diesel and gasoline starting in 2040 as part of a sweeping plan to tackle air pollution that experts say is feasible, if ambitious.

The government announcement Wednesday follows similar moves in France and Norway and comes amid a global debate on how quickly electric and hybrid cars can replace internal combustion engines.

Traditional engines running on diesel and gasoline are still popular with consumers as they’re relatively cheap and do not face some limits of electric cars, such as a limited range.

But with the technology for electric and hybrid cars improving, governments are trying to set long-term goals to help guide the investments of automakers and, ultimately, consumers’ choices.

Britain’s government said it would put up 255 million pounds ($326 million) to help local communities address diesel pollution. The measures are part of a clean air strategy that authorities published only days before a deadline mandated by the High Court. The money is part of a 3 billion pound effort to clean up the air.

The government plan includes the consideration of a targeted scrappage scheme for drivers who need support and to provide an incentive to switch vehicles.