Brazil's Supreme Court has batted down challenges to key parts of a law that environmentalists say has contributed to increasing deforestation in the Amazon rainforest.

The 2012 law included an amnesty for illegal deforestation that occurred before July 2008, including releasing perpetrators from the obligation to replant areas in compensation. It also weakened protections for some preservation areas by expanding the sorts of activity allowed in them. It was backed by farming interests.

Wednesday's court ruling rejected most of the challenges to the law.

Brazil's non-governmental Socio-environmental Institute says researchers believe the law contributed to rising rates of Amazon deforestation starting in 2012 after years of decreases. However, the rate fell in 2017 as compared to 2016, which saw an exceptionally large swath of forest cut.