What are the economic and ecological consequences of an environmental regulation? This study aims to answer this question by evaluating the intended and unintended consequences of a regulation passed in Brazil to foster the preservation of the Amazon rainforest. Using a set of spatial differences-in-differences and event study analysis, our results evidence that the new regulation contributed to reducing deforestation in the Amazonian biome to similar levels to outside. However, the new forestall code fostered the expansion of conventional agribusiness firms – producing soybeans and cattle – into the Amazon. The mechanisms behind these paradoxical results lay in the endogenously built environmental regulation, which, despite attending to ecological concerns, was built to reinforce the market power of large agribusinesses in the region. The new ecological regulation granted agribusiness firms institutional security for their investments and favored their expansion into the Amazonian biome. This study shows how environmental regulation can have intended and unintended consequences and how these effects can affect not only ecological outcomes but, most importantly, the local market equilibrium.