About 25,000 years ago in Western Europe, the last cave bear drew its final breath and the species went extinct.

But a study published in Nature Ecology & Evolution finds that some cave bear DNA lives on in modern brown bears, much like humans carry around a bit of Neanderthal.

It challenges our view of extinction, said Ludovic Orlando, a professor at the Centre for GeoGenetics at the Natural History Museum of Denmark, who was not involved in the research. “Extinction does not imply that genetic material is gone forever.”

In the study, researchers set out to learn more about the cave bear by studying its genetics. Almost as a lark they compared that genetic sequence with a sequence of a brown bear, said Axel Barlow, the lead author and a postdoctoral researcher at the University of Potsdam in Germany. The results surprised them. “There was a really quite obvious signal of hybridization between these species,” he said.

The team then compared the cave bear genome to that of seven other brown bears — one ancient and six modern — and found the same genetic mixing. Cave bears contributed from just under 1 percent to 2.4 percent of the genomes of brown bears, the study showed. “We did not expect to find this at all because they’re really quite diverse in terms of their evolution,” Barlow said.

The team found that the genes flowed both ways between species, with the cave bears also carrying some brown bear DNA. The most recent transfer of genes came from the cave bear to the brown, the study said.

Brown bears are more closely related to polar bears than they were to cave bears from whom they diverged more than a million years ago, Barlow said. Cave bears were largely herbivores, while brown bears are meat-eaters and about 20 percent smaller than cave bears. A brown bear would probably have looked “wimpy” next to a cave bear, he said.