The Paris agreement, signed by 197 countries in 2015, aims to reduce global warming by obliging each country to set ‘nationally determined' objectives to reduce CO2 emissions every five years.
Switzerland has committed to halving its CO2 emissions by 2030, compared with 1990 levels.
It will make steps in that direction by changing the law on CO2 emissions, to include increased taxes on CO2 and the tightening of emissions rules for vehicles.
Switzerland's joining of the accord was approved by parliament's upper house, the Council of States, by 39 votes to three – with the trio of dissenters members of the right-wing Swiss People's Party (SVP), reported news agencies.
One, Wener Hösli, said Switzerland should be aiming for a less ambitious target at this stage, fearing the effect on the economy.
It wasn't necessary to be part of the Paris agreement to implement climate-friendly policy, he added.
But the agreement is necessary, argued the majority, particularly in a country like Switzerland which sees the consequences of global warming in its melting glaciers and extended periods of hot weather.
No country will be spared the effects of climate change and therefore the solution must be global, added Liberal-Radical Raphaël Comte, who joined others in criticizing US President Donald Trump's decision to pull out of the Paris agreement.
Swiss President and environment minister Doris Leuthard said doing nothing would be far more costly than taking action to stop global warming.
Reaching the 50 percent target would not be easy, she said, but added “A bit of courage and ambition doesn't do any harm in politics”.
Switzerland has already made steps to increase its investment in renewable sources of energy with its energy strategy 2050, which was passed by the people in a referendum last month.
As well as committing the country to withdrawing from nuclear power, the strategy focuses on exploiting hydropower and other renewable resources, increasing energy efficiency and tightening emissions rules for vehicles.
The strategy only went to the public vote because it was opposed by the SVP, which claimed it was too expensive.
And according to Swiss media it is not out of the question that the SVP will launch another referendum campaign against the CO2 law change – though no steps in that direction have yet been announced.
In Switzerland anyone can challenge a piece of new legislation with a referendum, if they gather the required number of signatures.