FILE PHOTO: A Tesla logo is seen in Los Angeles, California U.S. January 12, 2018. REUTERS/Lucy Nicholson

BERLIN (Reuters) - Tesla Inc TSLA.O got approval from a German court on Thursday to continue to cut down forest near the capital Berlin to build its first European car and battery factory, in a defeat for local environmental activists.

The court said in a statement it had rejected urgent applications to stop the land being cleared of trees from several environmental groups, adding its ruling was final. It had temporarily halted the tree felling earlier this month.

The U.S. electric carmaker announced plans last November to build a Gigafactory in Gruenheide in the eastern state of Brandenburg that surrounds Berlin, a decision that was initially lauded as a vote of confidence in Germany.

However, local and national lawmakers were caught out by the strength of opposition to the Gigafactory, with hundreds of demonstrators protesting over what they say is the threat it poses to local wildlife and water supplies.

Lawmakers from Germany’s pro-business Christian Democrat and Free Democrat parties had warned that the legal battle waged against the Gigafactory would inflict serious damage on Germany’s image as a place to do business.