“Real Olympic athletes who have spent their whole life waiting for this moment.”

Although only athletes whose gender has been questioned will be tested in Beijing, the lab is a relic of an earlier Olympic era, when every female athlete was required to submit to a sex-verification test before competing in the Games. The tests emerged in the 1960s, when the Soviet Union and other Communist countries were suspected of entering male athletes in women’s events to gain an edge.

At first, women were asked to parade nude before a panel of doctors to verify their sex. At the 1968 Olympics in Mexico City, officials switched to a chromosomal test.

The tests never unmasked a man posing as a woman, but they did turn up several athletes who were born with genetic defects that made them appear  according to lab results, at least  to be men. In 1967, the Polish sprinter Ewa Klobukowska was barred from the sport because she failed the chromosomal test, even though she had passed the nude test a year earlier. In the 1980s, the Spanish hurdler Maria José Martínez Patino was disqualified because the test revealed, to her surprise, that she was born with a Y chromosome. Her eligibility was reinstated in 1988.

The practice came under increasing criticism in the 1990s by doctors, scientists and athletes who argued that the tests were not just invasive, but were also bad science. During the 1996 Atlanta Games, eight athletes failed the test, but all were later cleared of suspicion because it was determined that they had a birth defect that did not give them an unfair advantage.

“It was an unethical, unscientific and discriminatory practice,” said Arne Ljungqvist, the chairman of the International Olympic Committee’s medical commission and one of the most outspoken critics of the testing.