Giraffes grew their long necks to have head-butting battles with love rivals.
Scientists have argued that the animals need their distinctive long necks more for combat rather for reaching for food on trees, with the new hypothesis emerging from China.
An analysis of an early giraffe ancestor's head and neck fossils has suggested that breeding was a priority for the evolution of the species.
Dr. Meng Jin - from the Chinese Academy of Sciences - said: "It is possible that, among giraffe ancestors during this period, mating males developed a way of attacking competitors by swinging their necks and heads.
"This extreme struggle, supported by sexual selection, thus led to the rapid elongation of the giraffe's neck over two million years."