All new cars and light-duty trucks sold in B.C. will be clean-energy vehicles by 2040, after the provincial government passed legislation cracking down on gas-only vehicles on Wednesday.

The province says the Zero-Emission Vehicles Act will boost B.C.'s commitment to clean energy.

The act sets a target of 10 per cent zero-emission vehicle sales by 2025, 30 per cent by 2030 and 100 per cent by 2040.

"With federal and provincial rebates now in place, switching to an electric vehicle is more affordable than ever," said Michelle Mungall, minister of energy, mines and petroleum resources, in a news release.

The province claims B.C. residents are buying the most zero-emission vehicles per capita in the country, forcing the government to top up an incentive plan.

"By requiring that a percentage of vehicle sales in B.C. be zero-emission models, automakers will respond to the demand by offering consumers more choices," said Environment Minister George Heyman in the statement. "Along with greener options like transit, the increased adoption of zero-emission vehicles will help lower emissions in our transportation sector."

The rise in purchases of electric and hybrid vehicles comes as B.C. struggles with record high gas prices.

The province's utilities commission is holding an inquiry into why B.C. residents are hit with some of the highest gas costs in the country, as well as how it could potentially moderate price fluctuations.