Raúl Jara’s grandfather tilled a rich man’s land on the outskirts of Lima, Peru, until agrarian reform in the nineteen-sixties made four acres of it his. By the time Raúl was born, in 1971, Lima had grown to surround the Jaras’ compound, making their walled garden of bananas and bougainvillea an oasis from the increasingly chaotic and polluted capital city. Raúl, an only child, was the first member of his family to go to college, and six times a week he would travel an hour and forty-five minutes by minibus to an oasis of another kind, the campus of Pontificia Catholic University, where he and his fellow engineering students immersed themselves in the elegant exactitude of mathematics. Peruvians like to say that they have the world’s best-educated taxi-drivers, because only a fraction of Peruvian college graduates find professional jobs. Raúl was an exception. After graduation, he worked as a teacher of computerized industrial drawing, then as an engineer at a gold mine, until, finally, he was hired at a copper mine set more than thirteen thousand feet up in the Peruvian Andes.

Peru’s per-capita gross domestic product is less than that of Namibia or the Dominican Republic, but the Anglo-Australian Tintaya copper mine is a decidedly First World operation. The man-made canyon of the open pit is bordered by a spotless miniature city—neat workers’ houses with flowers out front, garden apartments, a chapel, a hotel, a hospital, a health club, and office buildings. The rules of conduct are enforced with the rigor of a military academy: no walking in the street, no crossing outside the zebra stripes, no smoking, and orange vests and hard hats required everywhere. The mine’s obsessive rectitude, amid the nearly uninhabited high grassy plains and snow-capped mountains of southeastern Peru, is as anomalous as a moon colony in a science-fiction story. Engineers at Tintaya work in cubicles, each with a late-model I.B.M. ThinkPad attached to a nineteen-inch L.C.D. monitor, their whiteboards covered with dizzying graphs, parabolas, and complicated equations. When Raúl started at Tintaya, as a geotechnical engineer, he examined soil samples and computed the angle at which to cut the wall of the pit, and then, as an ingeniero de costos, he analyzed the budget and developed new projects. He worked twelve-hour shifts ten days in a row, and earned thirteen hundred dollars a month, almost ten times the minimum wage. During his four days off, he would travel twenty-three hours by bus over rough roads back to Lima, where his friends and relatives would welcome him with a pachamanca, a feast of meats cooked slowly underground.

Though happy in his job, Raúl yearned for a life as orderly as the mine, for a country that funded education and parks, regulated air pollution and noise, and policed its own lawmakers. Once, when Raúl and some other engineers made a road trip to Chile, he noticed that in Peru the driver gleefully exceeded the speed limit, passed on the right, even blew through stop signs, but in Chile he was careful not to speed, and was scrupulous about stop signs and railroad crossings. “They have laws here,” the man said. When a colleague went to work in Canada, Raúl asked his boss about the possibility of a transfer, but he was told that he didn’t speak English well enough.

On one of Raúl’s four-day furloughs in the fall of 2002, he was walking in downtown Lima with his girlfriend, Liliana Campos, a willowy beauty with the graceful half-moon nose of her Inca ancestors. Lily, as she is called, was then twenty-five and living with Raúl’s parents while she studied to be a nurse. A red-white-and-blue sign caught their attention: “Sorteo de Visas!” Every autumn, storefront businesses decorated with American flags bloom across Lima like rockrose. Tall cardboard signs are taped onto windows or on sandwich boards placed on the sidewalk, festooned with Old Glory, the Statue of Liberty, and exhortatory phrases: “Lotería de Green Card!” or simply “Puedes Ganar”—“You Can Win.” Raúl and Lily had never given the lottery much thought, but this time they paid a couple of dollars to have their pictures taken and to get some help in filling out forms. Then, like most people who enter a lottery, they forgot all about it.

The official name of the program known as the Green Card Lottery in Peru—and in a hundred and seventy-six other countries—is the Diversity Visa Program. Of the more than two hundred visa types provided by the State Department, it is by far the oddest. While the vast majority of immigrant visas still go to people who suffer persecution or possess strictly prescribed qualifications—relatives already in the U.S., strategic skills, or great wealth—the only requirement for winning the Green Card Lottery, other than good fortune, is a high-school education or two years’ experience in one of three hundred and fifty-three career categories ranging from anthropologist to housepainter to poet-and-lyricist. Fifty thousand diversity visas are made available each year; almost six million people applied to the program in 2005. Its future, however, is uncertain. Last month, the House of Representatives passed a border enforcement and immigration bill that included an amendment to abolish the Green Card Lottery. The Senate will consider that bill later this year.

The lottery began—in the name of diversity—as a way to bring more white people to America. It was, so to speak, a correction to a correction to a correction. The earliest immigration laws, from the late eighteen-eighties, favored Northern Europeans. In 1965, at the height of the civil-rights movement, Congress changed the laws to favor relatives of American citizens or permanent residents, regardless of origin, and Asians, Africans, and Latin Americans began arriving in record numbers, while European immigration plummeted. The shift alarmed many members of Congress, who argued for legislation that would, in the words of Senator Alfonse D’Amato, relieve the “painful, and even tragic problems for Irish, Germans, Italians, Poles, and others without immediate family members in the United States.” The result, in the early nineteen-nineties, was a series of short-lived diversity-visa programs designed to bring more European immigrants, especially English-speakers, to the United States. From 1992 to 1994, forty per cent of diversity visas were set aside for immigrants from one country: Ireland. When the Irish exception expired, in 1995, Congress decided the lottery should cover the whole world—except those countries thought to be overrepresented in the immigrant pool. That list now includes Mexico, Colombia, the Dominican Republic, El Salvador, Haiti, Jamaica, China (not including Hong Kong), Russia, India, Pakistan, the Philippines, South Korea, Vietnam, the United Kingdom (except Northern Ireland), Poland, and Canada. Winners of the lottery qualify for immediate permanent-resident cards—green cards—which allow them to live and work in the United States as long as they like and to move toward citizenship. Some countries, like Ethiopia and Egypt, had more than six thousand qualified winners last year. Andorra, Liechtenstein, the Pacific island nation of Niue, and the French Southern and Antarctic Territories each had one. The Cocos Islands had two, Suriname had three, and the Seychelles had four.

Whatever the lottery does to diversify the immigrant pool, it is a splendid overseas marketing campaign for the American Dream. That a carpet installer or pipe fitter in Ouagadougou or Yerevan who would otherwise have no hope of emigrating might suddenly be handed a green card is a notion as powerful as that of the orphan who becomes President or the twenty-five-year-old who pulls the right lever in Las Vegas and wins forty million dollars. The odds aren’t bad: at a hundred and eighteen to one, they’re considerably better than the forty-five-million-to-one odds of winning first prize in the New York Lotto.