Final approval was given on Tuesday for a law that will bring an end to the sale of vehicles running on CO2-emitting fuels by 2035, Swedish Energy Minister Ebba Busch announced.
Energy ministers from the 27 member states gave the go-ahead for the contested law which had been delayed for weeks by Germany's Transport Minister Volker Wissing.
A compromise was agreed between Brussels and Berlin on Saturday that will allow the sale of cars and vans that run on so-called climate-neutral e-fuels which use synthetic fuels produced with captured carbon.
The move is an attempt to curb the bloc's CO2 emissions which have a major impact on global warming and the subsequent plethora of dangerous effects on the planet.
Transport is accountable for around 25% of the EU's emissions.
Pushback on the phase-out
Although Germany was able to water down the law, it was not the only member state to raise opposition. Poland's energy minister voted against the law while representatives from Romania, Italy and Bulgaria abstained.
Opposition has stemmed from fears of the rising costs of vehicles. Italy had also pushed for an exemption to be made for biofuels.
Not only governments but also car producers had pushed back on the phase-out. German luxury car manufacturer Porsche and Italian producer Ferrari had complained that the necessary batteries for electric cars would be too heavy for their vehicles.
Other carmakers, such as Volkswagen, Mercedes-Benz and Ford are already betting on electric vehicles amid a push to find moderate solutions to reducing carbon emissions.