Editor's Note: The following is an excerpt from Mara Hvistendahl's book, Unnatural Selection: Choosing Boys over Girls and the Consequences of a World Full of Men.

The technology that ultimately became the dominant method of sex selection around the world began as a tool for navigation. The story of ultrasound dates to 1794, when an Italian biologist curious about how bats find their way in the dark discovered sonar, or the fact that distance can be determined by bouncing sound waves off a faraway object and measuring how long it takes for the waves to ricochet back. Centuries later, when the growing prowess of German submarines during World War I convinced the Allies that to win the war they needed a way to navigate underwater, scientists put sonar to use. The American, British, and French governments jointly funded research into the phenomenon. The effort succeeded, and by 1918 the Allies were using acoustic echoes to correctly pinpoint the location of German U-boats.

After the war, doctors guessed sonar might have medical applications as well. They first used ultrasound in surgery, where it turned out sound waves could heat and destroy tissue, making them helpful for everything from treating ulcers to performing craniotomies. Then in 1949 a chemist stationed at the Naval Medical Research Institute in Bethesda, Maryland, employed the new technology to locate gallstones in dogs, and ultrasound became a diagnostic tool as well. Physicians began navigating the human body as World War I submarines had navigated dark waters, bouncing sound waves off the internal organs.

Ultrasound proved surprisingly versatile. It could clean teeth, treat cysts, and dissolve kidney stones. It may have been with one of these applications in sight that in 1959 Scottish obstetrician Ian Donald used the new technology on a woman who happened to be pregnant and noticed that the fetus returned echoes as well.

Back then, ultrasound offered the simple promise of learning more about a pregnancy. Doctors could not perform x-ray exams on pregnant women because of the risk of damaging the fetus, so Donald’s discovery raised the prospect of an alternative form of prenatal imaging, giving physicians hope of monitoring high-risk pregnancies. If Donald suspected that knowledge would translate into fetal selection and subtraction, he probably envisioned women attempting to avoid debilitating sex-linked diseases like hemophilia. (When the first sex-selective abortions had been performed in Denmark using amniocentesis four years earlier, indeed, they were done for that reason --and discriminated against males as a result.) He could have hardly guessed that ultrasound would one day contribute to a sex ratio imbalance involving  over 160 million "missing" females in Asia and elsewhere.

Sex selection was a dim possibility, indeed, because early ultrasound machines were nothing like those available today. The 1960s machines were cumbersome gadgets that towered over the pregnant women on whom they were used. One model, called the articulated arm scanner, resembled a giant version of the toy cranes fairgoers rent for a few quarters to try their hand at winning stuffed animals. The articulated arm scanner helped doctors take crude measurements of the fetal head, allowing them to track a baby’s growth in the womb. But beyond that the image it produced was hazy, making it impossible to discern fingers and toes, let alone a tiny penis or vagina.

It didn’t matter that the early ultrasound machines yielded fuzzy images, however, or that they only proved helpful in a small proportion of pregnancies. To the 1960s public the technology looked positively futuristic. Around the time pregnancy became a choice rather than an inevitability and the business of having children became about more than generating labor for the farm, we began seeking ways to bond with our babies before birth. An image on which to pin parental hopes made that task a whole lot easier, and so it was a breakthrough to have a preview, however muddled, of the baby growing inside a mother’s uterus. Coming at a time of technological optimism when Americans were enamored of outer space and kitchen appliances alike, an era some were calling the Biological Revolution, ultrasound captured the public imagination.

Even though the high-resolution machines capable of identifying fetal sex and other finer characteristics were still years away, the press seized on the possibility that portraits of babies before birth might help us control the mystical birth process. The flurry of coverage that greeted the new technology forecasted extensive reproductive manipulation—which newspaper editors saw as a great thing. The headlines were bold and optimistic: Ultrasound Device Takes Guessing Out of Pregnancy. Knowledge Is Key to Happy Childbirth. A New Eye into the Womb. One article dubbed ultrasound The Electronic Doctor. The headline on the cover of the September 10, 1965, issue of Life—alongside a hulking machine whose heavy arm nearly eclipsed the mother under examination— read Control of Life: Audacious Experiments Promise Decades of Added Life, Superbabies with Improved Minds and Bodies, and Even a Kind of Immortality. (Today preimplantation genetic diagnosis—a form of embryo screening during in-vitro fertilization that allows parents to select for sex, is greeted with similar enthusiasm. Girl or Boy? Now You Can Choose, proclaimed a 2004 cover of Newsweek.)

But public fascination also provided a window for criticism, and ultrasound elicited substantial ethical deliberation. Some critics feared overly powerful scientists. Feminists pushing for abortion rights fretted, justifiably, that the machine humanized the fetus. Others worried the new reproductive technology would be exploited by governments intent on manipulating their populations; the Nazis, after all, had screened newlyweds for genetic diseases in their eugenics program. What if the power to create "superbabies" fell into the hands of an evil dictator? But none of these critiques came close to identifying what turned out to be ultrasound’s most pernicious threat. In hindsight, 1960s Americans worried about everything except the possibility that average parents, emboldened by the new knowledge technology brought them, might make small, seemingly innocuous choices—and that those choices, taken together, would add up to disaster.

Excerpt by arrangement with Public Affairs from Unnatural Selection: Choosing Boys over Girls and the Consequences of a World Full of Men by Mara Hvistendahl. Copyright © 2011 by Mara Hvistendahl.