A near-perfect fossil unearthed close to Madrid appears to be an ancient European ancestor of giraffes, representing a new species in the family and one that had two sets of bony bumps on its head rather than the single set of modern giraffes.

Older fossils in the family known as giraffids have been found before, but none in such pristine condition, said Ari Grossman, an associate professor of anatomy at Midwestern University in Glendale, Ariz., who was not involved in the finding but said the whole field would benefit from it.

“It’s something most paleontologists dream of and very rarely find,” Dr. Grossman said. “The discovery in and of itself was breathtaking.”

Fossils of three other animals of the same species named Decennatherium rex by the researchers were also found, according to a new study in the journal PLOS One. They were not as complete, but all are about nine million years old and provide evidence that ancestors in the giraffe family lived deep inside Europe much earlier than had been suspected. The fossils also suggest that there were physical differences between males and females.