A historic deal to halt the mass extinction of species was finally agreed last night in what conservationists see as the most important international treaty aimed at preventing the collapse of the world's wildlife.

Delegates from more than 190 countries meeting in Nagoya, Japan, agreed at the 11th hour on an ambitious conservation programme to protect global biodiversity and the natural habitats that support the most threatened animals and plants.

After 18 years of debate, two weeks of talks, and tense, last-minute bargaining, the meeting of the UN Convention on Biodiversity agreed on 20 key "strategic goals" to be implemented by 2020 that should help to end the current mass extinction of species.

The sweeping plan to put the brakes on the loss of species includes a set of new targets to be implemented by the end of the decade that will give greater protection to the natural world and enshrine the benefits it gives to humankind in a legally binding code of protection.

"This agreement reaffirms the fundamental need to conserve nature as the very foundation of our economy and our society," said Jim Leape, director general of the conservation group WWF International.

"Governments have sent a strong message that protecting the health of the planet has a place in international politics, and countries are ready to join forces to save life on Earth," Mr Leape said.

One of the 20 targets agreed by the delegates was to extend national parks to increase the area of protected land in the world from 12.5 per cent to 17 per cent, and the area of protected oceans from 1 per cent to 10 per cent by 2020. Another target is to lift threatened species from the risk of extinction.

Environment ministers from around the globe also agreed on rules for sharing the commercial benefits of nature's genetic resources between governments and companies, a key trade and intellectual property issue that could be worth billions of dollars in new funds for developing nations.

One idea enshrined in the new protocol is to set up a special fund from a proportion of the profits made from commercial products derived from biological material collected decades or even centuries ago from natural habitats in the developing world.

Caroline Spelman, Britain's Environment Secretary, said last night from Nagoya: "We have also agreed an historic protocol which has been 18 years in the making, establishing a regime where developing countries will allow access to their genetic and natural resources in return for a share of the benefits for their use."

This feature of the agreement was the biggest stumbling block to a deal because of concerns by developing nations that they would miss out on the revenues generated by Western companies that discover new drugs and medicines derived from studying the chemistry and genetics of species living in regions rich in biodiversity.

Developing nations, particular in Africa, had argued they had not benefited in the past from their natural resources which had been developed into lucrative products by wealthy Western countries.

Poorer countries had insisted that the cost of increasing their spending on the conservation of natural habitats had to be offset by some financial mechanism that paid them for the benefit of the genetic resources they were protecting.

Johansen Voker of Liberia's Environmental Protection Agency had said: "The forest and the other biological resources we have serve the general interests of the global environment. So we expect assistance to be able to effectively conserve our environment for the common good of the world community."

The Nagoya meeting agreed to establish an International Regime on Access and Benefit Sharing of Genetic Resources to lay down the basic ground rules on how nations co-operate in obtaining genetic resources from animals, plants and fungi.

Achim Steiner, head of the UN Environment Programme, which administers the Convention on Biological Diversity, said: "This is a day to celebrate in terms of a new and innovative response to the alarming loss of biodiversity and ecosystems. And a day to celebrate in terms of opportunities for lives and livelihoods in terms of overcoming poverty and delivering sustainable development."

Ms Spelmen said the agreement sets out a plan to halt the loss of habitats that provide essential biological services for the benefit of people, such as the supply of fresh water. This, she insisted, would help to eradicate poverty. "We have also secured an agreement to link climate change, global poverty and biodiversity together in protecting the world's forests, which is essential if we are to achieve our aims in these areas," she said.

Last week, a report by the Zoological Society of London warned the populations of mammals, birds, reptiles, amphibians and fish have declined by 30 per cent over 40 years and that one-fifth of all vertebrate species are threatened with extinction.

Centres of biodiversity

Chihuahuan Desert

Home to one of the richest cactus communities in the world, the desert also harbours a rare example of an inland-desert wetlands - Cuatro Cienegas. Snails and fish there have radiated into many species, some restricted to a single pool.

Indo-Pacific coral reefs

Reefs in the tropical western Pacific are the world's most diverse. Some off western New Guinea are home to 525 species of reef fish and 450 species of coral. The world trade in aquarium fish and large food fish is having a devastating impact, as is sedimentation and pollution.

Antarctic Peninsula

Large populations of marine mammals, birds and fish depend, directly or indirectly, on shrimp-like krill in surrounding waters. One of the last relatively intact marine ecosystems, the peninsula is a breeding ground for many species. Increased ultraviolet radiation due to ozone depletion threatens the area.

Andean Forests

The rugged terrain of the northern Andes hosts an enormous diversity of habitats. Single peaks or valleys are home to several species of birds, orchids, and other organisms found nowhere else. One of the world's highest concentrations of endemic birds inhabits peaks on the Ecuador-Colombia border.

Atlantic Forests

The Atlantic forest region, most of it in Brazil, is a criticially endangered ecosystem. Less than 7 per cent of the original vegetation remains. Early naturalists found forests draped with orchids and bromeliads and ringing with the sounds of animals. Today, the four endemic species of tamarins are all endangered, including the black-faced tamarin, which was discovered by scientists only in 1990.

Cape Floristic Region

This area in South Africa holds a unique collection of hard-leaved and evergreen shrubs called 'fynbos' and is home to more than 8,000 plant species, around 70 per cent of which are endemic. The greatest threats to this diverse plant life are invasive alien species and habitat loss.

Mediterranean region

From Portugal to Jordan, from Morocco to southern France, this eco-region is fragmented and threatened by burning, grazing, human settlement and tourism. The region is one of five sites of Mediterranean shrub land in the world, which collectively contain 20 per cent of all terrestrial plant species.

Western Ghats

A large number of endemic species, some traced back to forebears on the ancient supercontinent of Gondwana, have evolved on India's long-isolated western mountain ranges. Sixteen bird species and at least 1,500 plant species live only in this region. Pressure from expanding human population, logging and farming is intense.

Siberian Taiga

Earth's largest unbroken forest, this is among the last regions vast enough to allow populations of large predators to interact naturally with prey. A network of wetlands is a critical breeding habitat for many species of waterfowl, shorebirds and the endangered Siberian crane.

New Guinea Forests

One of the last great forest wildernesses, long-isolated New Guinea has never been colonised by monkeys or most other large mammals. Their niches are filled instead by reptiles, marsupials and birds.

New Zealand