LAUSANNE, Switzerland (Reuters) - The imminent danger posed by climate change means activists were not guilty of trespassing when they occupied a Swiss bank and played tennis to demand an end to funding of fossil fuel projects, a judge ruled on Monday.

Slideshow ( 2 images )

Wearing whites and wigs, a group of young people staged the tennis sit-in at the Lausanne branch of Credit Suisse in November 2018 to highlight their campaign and urge Swiss maestro Roger Federer to end his sponsorship deal with the bank.

The activists were charged with trespassing and fined 21,600 Swiss francs ($22,200), but in their appeal hearing on Monday Judge Philippe Colelough said they had acted proportionately and waived the fine.

The activists had argued they were in the bank in the face of an “imminent danger” - and the judge agreed.

“Because of the insufficient measures taken to date in Switzerland, whether they be economic or political, the average warming will not diminish nor even stabilize, it will increase,” he said, pointing to the country’s melting glaciers.

“In view of this, the tribunal considers that the imminence of danger is established,” the judge said. “The act for which they were incriminated was a necessary and proportional means to achieve the goal they sought.”

The packed court room in Renens, Lausanne, reacted with whoops of excitement and a standing ovation.

“I didn’t think it was possible,” said one of the accused, Beate Thalmann, in tears of joy. “If Switzerland did this, then maybe we have a chance.”

Pressure is rising on Switzerland’s financial sector to divest from fossil fuels and thousands of students have marched through Swiss cities in recent months demanding action on climate change.

The country, which is warming at twice the global average due to the heat-trapping effect of its mountains, has an target to cut net carbon emissions to zero by 2050 but activists say that the country’s biggest impact is via the financial center.

Credit Suisse, which had filed charges against the activists, said last week, when they launched the appeal after refusing to pay the fine, it respected their cause but deemed their actions unacceptable. The state will pay the fine instead.

The bank said in December said it would stop financing the development of new coal-fired power plants.

Federer, who was also criticized by teen climate activist Greta Thunberg over the sponsorship, said at the weekend: “I appreciate reminders of my responsibility as a private individual, as an athlete and as an entrepreneur, and I’m committed to using this privileged position to dialogue on important issues with my sponsors.”

“I take the impacts and threat of climate change very seriously, particularly as my family and I arrive in Australia amidst devastation from the bushfires,” the 38-year-old, preparing for the Australian Open, said in a statement.

A spokeswoman added on Monday that his dialogue with Credit Suisse on its climate change impact had already begun, without giving details.