IN THE 1990s, when an area of Brazilian rainforest the size of Belgium was felled every year, Brazil was the world’s environmental villain and the Amazonian jungle the image of everything that was going wrong in green places. Now, the Amazon ought to be the image of what is going right. Government figures show that deforestation fell by 70% in the Brazilian Amazon region during the past decade, from a ten-year average of 19,500 km2 (7,500 square miles) per year in 2005 to 5,800 km2 in 2013. If clearances had continued at their rate in 2005, an extra 3.2 billion tonnes of carbon dioxide would have been put into the atmosphere. That is an amount equal to a year’s emissions from the European Union. Arguably, then, Brazil is now the world leader in tackling climate change.

But how did it break the vicious cycle in which—it was widely expected—farmers and cattle ranchers (the main culprits in the Amazon) would make so much money from clearing the forest that they would go on cutting down trees until there were none left? After all, most other rainforest countries, such as Indonesia and the Democratic Republic of the Congo, have failed to stop the chainsaws. The answer, according to a paper just published in Science by Dan Nepstad of the Earth Innovation Institute in San Francisco, is that there was no silver bullet but instead a three-stage process in which bans, better governance in frontier areas and consumer pressure on companies worked, if fitfully and only after several false starts.

The first stage ran from the mid-1990s to 2004. This was when the government put its efforts into bans and restrictions. The Brazilian Forest Code said that, on every farm in the Amazon, 80% of the land had to be set aside as a forest reserve. As the study observes, this share was so high that the code could not be complied with—or enforced. This was the period of the worst deforestation. Soyabean prices were high and there was a vast expansion of soyabean farming and cattle ranching on the south-eastern fringe of the rainforest.

During the second stage, which ran from 2005 to 2009, the government tried to boost its ability to police the Amazon. Brazil’s president, Luis Inácio Lula da Silva, made stopping deforestation a priority, which resulted in better co-operation between different bits of the government, especially the police and public prosecutors. The area in which farming was banned was increased from a sixth to nearly half of the forest.

Also, for the first time, restrictions were backed up by other things: a fall in export earnings from soyabeans because of a rise in Brazil’s currency, the real; a sharp improvement in cattle breeding which meant farmers could raise more animals on fewer hectares; and a consumer boycott. After a campaign by Greenpeace and others, buyers of Brazilian soyabeans promised not to purchase crops planted on land cleared after July 2006. All of these combined to cause deforestation to plummet (see chart).