Image copyright Cambridge University Botanic Garden Image caption Botanic gardens like this one in Cambridge, UK, are a haven for rare plants

The world's botanic gardens contain about a third of all known plants and help protect 40% of endangered species, a study has found.

Scientists say that with one in five of the world's plants on the brink of extinction, botanic collections hold the key to saving rare plant life.

In the first detailed study of plants grown in botanical gardens, they recorded more than 100,000 species.

Efforts are needed to target some of our rarest plants, they say.

"This is the first time that we have carried out a global assessment to look at the wide range of plants grown, managed and conserved in botanic gardens," said Dr Paul Smith, Secretary General of the charity Botanic Gardens Conservation International.

"So, for the first time we know what we have and, perhaps more importantly, what is missing from botanic gardens."

Tropical plants were under-represented in the inventory of species. Meanwhile, primitive plants such as mosses were fewer in number compared with exotic specimens such as orchids and lilies.

"Botanic gardens maintain in their living collections and seed banks an astonishing array of plant diversity, " Dr Smith explained.

"We think gardens should be making much more of what they can uniquely grow that no other garden or experts have ever grown before."

Image copyright Botanic Gardens Conservation International Image caption Peridiniya Botanic Garden in Sri Lanka: Tropical plants are under-represented worldwide

About 500 million people visit botanic gardens each year. As well as being popular visitor attractions, they are a centre of learning and education, and conduct valuable research and conservation work.

The study, published in the journal Nature Plants , identified gaps in the botanic collections of more than 1,000 institutions.

Many botanic gardens are in the Northern Hemisphere, where tropical species are harder to maintain as they need to be grown in heated glasshouses.

Tropical plants are best grown in their country of origin, but there are far fewer facilities in the Southern Hemisphere.

Furthermore, only 10% of global collections are dedicated to threatened species, suggesting botanic gardens could do more to preserve some of the world's most vulnerable plants.

Image copyright Botanic Gardens Conservation International Image caption Gardens By The Bay in Singapore

Dr Samuel Brockington of the University of Cambridge is a curator at the university's own botanic garden and co-researcher of the study.

He said the global network of botanic gardens was our best hope for saving some of the world's most endangered plants.

"Currently, an estimated one-fifth of plant diversity is under threat, yet there is no technical reason why any plant species should become extinct," he said.

"If we do not conserve our plant diversity, humanity will struggle to solve the global challenges of food and fuel security, environmental degradation, and climate change."

Follow Helen on Twitter .