During the Paris climate talks last December, Brazil broadcast its ambitions to reduce its overall emissions by at least 36 percent by 2020 and 43 percent in 2030. These may seem like lofty targets for a developing economy, but Brazil has a significant advantage in meeting its goal: it is already halfway there.

This is no small feat. In the 1990s, the country was a rabid logger, shaving off El Salvador-sized chunks of its rainforest every year. That had a significant impact on the climate since clearing forests releases carbon dioxide; deforestation is responsible for one-fifth of carbon emissions worldwide. But in Brazil, the rate of yearly deforestation fell 70 percent between 2005 and 2013 and so did its carbon footprint. Greenhouse gas emissions decreased 41 percent between 2005 and 2012.

Understanding Brazil’s remarkable transformation requires some historical context. Until the early 1960s, the country’s rainforest remained intact. But at the beginning of that decade, farmers ran out of cropland and began borrowing from the Amazon. They soon realized that the soil at the fringe of the forest was not fertile enough to sustain long-term growth and moved further in, eventually causing great amounts of tree loss. Because this was a new phenomenon, and strict surveillance of the forest did not exist at the time, policies forbidding logging in the Amazon were difficult to enforce.

The issue finally drew national attention in 2004 when government data revealed that the deforestation rate had hit a record high, climbing to roughly 17,000 square miles per year, from 7,500 in the 1990s. In an attempt to mitigate the havoc logging was wreaking on biodiversity and the climate, the Brazilian government began a rigorous program of prioritizing the environment, passing the right policies, and setting up an effective Amazon surveillance system to make sure its new anti-deforestation rules were followed. It helped that the environmental minister at the time, Marina Silva, was once a fierce environmental activist.

Enacting good legislation began with setting the right boundaries for legal deforestation. Brazil created the 20–80 rule, allowing private land owners to clear up to 20 percent of their land, while requiring that 80 percent remain untouched. When I asked Thomas Lovejoy, a biologist who has studied the Amazon for nearly 40 years, whether 20 percent is enough, he said that it is “a tipping point,” meaning that it is a good enough benchmark for preserving the forest and its biodiversity. But he also noted that the demarcation was political. Any stricter, and the rule would have generated unmanageable opposition from the business, agricultural, and ranching sectors, among others. They argue that deforestation is necessary to meet growing food needs.

The Amazon forest near Amazonas state, January 10, 2015. Bruno Kelly / Reuters

But in the end, the market worked in favor of the environmentalists. When demand for Brazil’s soya dropped between 2005 and 2009 after a rise in its currency, land clearings decreased as well. The government also barred farmers from obtaining cheap loans until the deforestation rates in their counties fell, while granting amnesty to farmers who had made illegal clearances before 2008.

Throughout this effort to save the rainforest, Brazil’s crop production did not suffer, contrary to the warnings of big agribusiness. Not only did it improve, but the country became one of the world’s agricultural superstars. Since the 1970s, the government has poured millions of dollars into tropical farming research. Scientists like Edson Lobato discovered ways to turn the acidic soil of Brazil’s vast central savanna know as the cerrado into fertile farmland. Now the focus is on making farming more efficient, whether it is increasing output on arable land or restoring degraded areas. Between 1991 and 2007, grain output rose by 129.7 percent, but the amount of land used to grow it expanded by only 25.9 percent.

These policies and investments were paired with aggressive surveillance of the forest. Lovejoy noted the complexity of the task: it requires constant monitoring of 2.1 million square miles—an area roughly half the size of the United States—for early signs of deforestation, such as small new clearings and fires. In 2010, the government partnered with the UN’s Reducing Emissions from Deforestation and Forest Degradation (REDD+) to enhance technological surveillance through satellite monitoring. One of the projects, PRODES, uses advanced Landsat satellites, which minimizes issues of interference from cloud cover. Drones can provide sharper, more detailed images to track smaller clearings that have increased over the years as farmers learn to evade detection.

To fund its efforts, Brazil has relied on national oil revenue and regular appropriations as well as international donations. In 2008, Norway began partnering with Brazil to help it fight deforestation. Norway has donated $1 billion to date to Brazil’s Amazon Fund, which it set up to receive investments for protecting “the lungs of the earth,” conditioning the funds upon a reduction in logging by 75 percent, a target that Brazil has met. UN Secretary General Ban Ki-moon called it “one of most impressive climate change mitigation actions of the past decades.” Norwegian Minister of Climate and Environment Tine Sundtoft noted that “Brazil has established what has become a model for other national climate change funds.”

This is not to say that Brazil’s progress came easily. It took impressive political willpower to make environmental protection a priority. And this struggle continues today with pro-business politicians gaining political power in recent years threatening to overturn conservationists’ gains. Brazil is still an impressive model for developing countries looking for a viable way to reduce logging. But the lesson here is that although protecting the earth is an ongoing endeavor. Brazil is only halfway up the hill in meeting its climate goals and a renewed commitment could keep it from rolling back to where it was in the 1990s.