Sorry Australia, you can no longer lay claim to the origins of the iconic New Zealand kiwi - the kiwi's closest relative is not the emu. 

Instead, the diminutive kiwi is most closely related to the extinct Madagascan elephant bird – a 2-3 meter tall, 275 kg giant. And surprisingly, a new study in Science concluded, both of these flightless birds once flew.

A new study by the University of Adelaide's Australian Centre for Ancient DNA (ACAD), has solved a 150-year-old evolutionary mystery about the origins of the giant flightless "ratite" birds, such as the emu and ostrich, which are found across the southern continents. This group contains some of the world's largest birds – such as the extinct giant moa of New Zealand and elephant birds of Madagascar.

The different "ratite" species were long thought to have formed as the flightless birds were isolated by the separation of the southern continents over the last 130 million years.

However, ancient DNA extracted from bones of two elephant birds held by the Museum of New Zealand, Te Papa Tongarewa, has revealed a close genetic connection with the kiwi, despite the striking differences in geography, morphology and ecology between the two.

"This result was about as unexpected as you could get," says Mr Kieren Mitchell, PhD candidate with ACAD, who performed the work. "New Zealand and Madagascar were only ever distantly physically joined via Antarctica and Australia, so this result shows the ratites must have dispersed around the world by flight."

The results correct previous work by ACAD Director Professor Alan Cooper conducted in the 1990s, which had shown the closest living relatives of the kiwi were the Australian emu and cassowary. "It's great to finally set the record straight, as New Zealanders were shocked and dismayed to find that the national bird appeared to be an Australian immigrant," says Professor Cooper. "I can only apologise it has taken so long!"

The team were able to use the elephant bird DNA to estimate when the ratite species had separated from each other.

"The evidence suggests flying ratite ancestors dispersed around the world right after the dinosaurs went extinct, before the mammals dramatically increased in size and became the dominant group," says Professor Cooper.

"We think the ratites exploited that narrow window of opportunity to become large herbivores, but once mammals also got large, about 50 million years ago, no other bird could try that idea again unless they were on a mammal free island – like the Dodo."

"We can now see why the evolutionary history of the ratites has been such a difficult problem," says co-author Professor Mike Lee, of the South Australian Museum and University of Adelaide. "Many of them independently converged on very similar body plans, complicating analysis of their history."

"We recently found fossils of small kiwi ancestors, which we suggested might have had the power of flight not too long ago," says co-author Flinders University's Dr Trevor Worthy. "The genetic results back up this interpretation, and confirm that kiwis were flying when they arrived in New Zealand.

"It also explains why the kiwi remained small. By the time it arrived in New Zealand, the large herbivore role was already taken by the moa, forcing the kiwi to stay small, and become insectivorous and nocturnal."

Alan Tennyson, Curator of Vertebrates at Te Papa, New Zealand's national museum, says: "The New Zealand kiwi is an integral part of this country's culture and heritage. It's fitting that Te Papa's scientific collections have been used to resolve the mystery of its origins."