Costa Rica got its forests back mainly by ending the subsidies that paid people to clear them. Crops, cattle and new roads cut forest cover from 77 per cent of the country to 41 per cent between 1943 and 1986, according to the World Resources Institute. The United Nations Environment Programme now puts it at more than 53 per cent.

In the 1950s Costa Rica cleared forest faster per head of population than any other country, the BBC World Service reported.

What drove the clearing

Beef did. Gerardo Bolaños, who runs the coastal reforestation charity Costas Verdes, estimates the country lost 70 per cent of its forest cover between the 1940s and the 1970s, and he blames a boom in livestock farming. Farmers burned the land and sowed grass for cattle, he told the Guardian.

Bernal Herrera-Fernández, a researcher at the National University of Costa Rica, said the north Pacific region had some of the worst rates. He noted that the link between ranching and forest loss, known as the “hamburger connection”, reached across much of Central America.

What turned it round

Money, moved in two directions. The government first offered tax deductions in the 1970s to landowners who restored degraded land. In the 1990s it replaced them with a scheme of payments for ecosystem services, which paid landowners to protect forest or plant trees.

The WRI argues that little changed until the subsidies for clearing stopped. In the mid-1980s the World Bank cut support for cattle ranching. The national herd shrank by a third, demand for pasture fell, and land was left to regrow. Herrera-Fernández gives a related account: once world beef prices fell in the mid-1980s, the government gradually withdrew its backing for ranching.

Law followed. The 1996 Forestry Law and the 1998 Biodiversity Law completed the legal framework against environmental damage, the University of Costa Rica ecologist Gerardo Avalos told the Guardian. By 2005 forest covered 2.45 million hectares, or 48 per cent of the country.

Where it did not work by itself

Not every abandoned pasture recovered. On the Pacific coast, poor soils had been worn out by years of hard farming, and many failed to regrow on their own, Bolaños said.

That gap drew volunteers. Costas Verdes, founded in 2009 by a surfer named Max Tattenbach, has planted more than 100,000 native trees across 34 beaches.

The country’s next target is harder. Its national plan, launched in February 2019, aims for net zero emissions by 2050, counting partly on keeping and expanding the forests it has regrown.