Most male birds start life having a penis but the organ withers away later in development.
How and why this happens has baffled scientists for decades. In terms of mating, a penis is a handy organ to have when reproducing by internal fertilisation.
Research published in the Cell Press journal Current Biology has now shown where, during a birds' development, their penises go.
A team from the University of Florida studied land fowl, which have only rudimentary penises as adults.
They found these birds have normally developing penises as early embryos but later on a genetic programme kicks in that leads their "budding penises" to stop growing and start to wither away.
The gene process that causes the penis to perish is called the Bmp4. In chickens, the gene switches on and the bird's genitals shrink away.
Researcher Martin Cohn explained: "Regulation of the balance between cell proliferation and cell death is essential for controlled growth and development.
"Too much cell division or too little cell death can lead to overgrowth or mis-regulated growth, as in cancer. If the balance is tipped in the other direction, deficient cell division or excess cell death can lead to underdevelopment or even absence of a tissue or organ.
"Our discovery shows that reduction of the penis during bird evolution occurred by activation of a normal mechanism of programmed cell death in a new location, the tip of the emerging penis."
Ana Herrera, lead author of the study, said they do not know exactly why birds lose their penises, but said it could be because it gives female birds more control over their reproductive lives.
Not all birds are without a penis - emus and ducks do, for example. However, birds that lack a male organ mate through a different means.
Instead of separate genital openings, they have a chamber called a cloaca. To breed, the male forces his cloaca against the female's, so the sperm cells can be transferred.
The researchers believe the study could have wide implications for studying genitalia loss in evolution.
Cohn said: "Genitalia are one of the fastest-evolving organs in animals, from molluscs to mammals. It is also the case that genitalia are affected by birth defects more than almost any other organ.
"Dissecting the molecular basis of the naturally occurring variation generated by evolution can lead to discoveries of new mechanisms of embryonic development, some of which are totally unexpected. This allows us to not only understand how evolution works but also gain new insights into possible causes of malformations."