Brazilian President Dilma Rousseff has vetoed parts of a controversial bill which regulates how much land farmers must preserve as forest.
Among the 12 articles which President Rousseff rejected is an amnesty for illegal loggers.
Brazil's farmers' lobby had argued that an easing of environmental restrictions would promote food production.
Environmentalists oppose the law, which the say will lead to further destruction of the Amazon rainforest.
The bill was approved by the Brazilian Congress a month ago. Environmentalists had urged President Rousseff to veto the entire bill.
President Rousseff rejected 12 articles from the bill and made 32 modifications to the text.
The exact details of the revised document have not yet been made public, but Brazilian Environment Minister Izabella Teixeira said the government wanted to avoid diminishing protected areas of the Amazon and other sensitive ecosystems.
The version of the bill passed by the Brazilian Congress last month would have allowed for huge areas of the country, which had been illegally logged before July 2008, to be opened up to farming.
It would also have allowed farming closer to riverbanks, which are especially vulnerable to erosion if trees are chopped down.
Officials said Ms Rousseff had rejected the article dealing with the riverbanks, ensuring their continued protection.
At a news conference, the ministers for the environment, agriculture and development said the president had struck a balance between preservation and sustainable development.
Brazil's farmers have long pushed for changes to the forest code.
They argue that uncertainty over the current legislation has undermined investment in the agriculture sector, which accounts for more than 5% of GDP.
But environmentalists campaigned for a total veto of the bill, which they said would spur deforestation in the Amazon rainforest.
Activist group Avaaz said it handed the government a petition with nearly two million signatures collected online from people in dozens of countries demanding a total veto.
The revised articles will now be sent back to Congress for another vote before they can come into force.