Inside a passport-photo van posted at the federal immigration office in Philadelphia, Annie Mehdeh took her shot at perhaps the most important game of chance she will ever play.

She uploaded her head shots and personal data into a computer, then pressed her palms together and prayed. If the 58-year-old Liberian wins, she will be allowed to stay in America forever, as will her teenage daughter.

Mehdeh had just entered the U.S. government's Diversity Visa Lottery, a 15-year-old sweepstakes that annually grants permanent residency to 50,000 foreigners, some here temporarily but most waiting abroad with high hopes of immigrating. By Wednesday, the 2010 deadline, about 12 million will have registered, free of charge, at the State Department's website. Winners will be notified in July.

The "green card lottery," as it is popularly known, targets countries with low rates of immigration to the United States.

Born in Liberia and uprooted by civil war, Mehdeh, a home-health-care aide, has lived in Southwest Philadelphia since 2000 under "temporary protected status." A humanitarian visa, it grants permission to work but does not confer permanent residency.

To stay here indefinitely, Mehdeh needs a green card, a prize for which people often wait decades.

Winning the lottery speeds the process exponentially. So Mehdeh decided to try her luck, paying to go online at the Rosa Photo van near 16th and Callowhill Streets because she doesn't own a computer.

The lottery allows winners to include children under 21, and to eventually sponsor other family members. So with her entry, Mehdeh provided data and a picture of her 19-year-old daughter, Lucy Garmondeh, who lives in Liberia's capital, Monrovia.

Lucy was born during Liberia's civil war "in a house with no food and no water," said Mehdeh, who has long dreamed of giving her the advantages of life in America.

"If you win, your life can improve immeasurably," said Robert Braun, owner of Immigration Information Services and the Rosa van. "It's the best lottery in the world."

A congressional amendment to the Immigration Act of 1990 created the lottery, with the first drawing in 1995. Entrants picked by computer become eligible for admission to America the following year.

Because the goal is diversity, individuals from overrepresented countries are ineligible. Canada, China, the Dominican Republic, El Salvador, Haiti, India, Jamaica, Mexico, the Philippines, South Korea, Taiwan, the United Kingdom (except Northern Ireland), and Vietnam were excluded from the first lottery - and for the most part still are.

But geopolitics and migration have brought changes to the list. Taiwan became eligible in 2002, while Colombia, Pakistan, Brazil, Peru, Ecuador, and Guatemala became ineligible over the years. Serbia, Montenegro, Kosovo, and East Timor became eligible as new nations. Poland and Russia lost eligibility, then were reinstated; in 2007, Poland was deemed ineligible again.

Like the college admissions process, more applicants are selected than are admitted. About 100,000 are notified via the Internet that their confirmation numbers were picked. That pool is whittled down to the 50,000 through State Department vetting. No single country may receive more than 7 percent of the visas.

In the 2009 lottery that admitted immigrants this year, about 70 percent came from Africa, Asia, South and Central America, and the Caribbean.

The nation with the highest number admitted this year was Ethiopia (3,829), followed by Nigeria (3,720) and Egypt (3,336).

The lottery's proponents say that promoting diversity helps strengthen America. Critics, however, contend that the process undermines fairness in the immigration system.

For example, highly skilled foreign workers whose talents are needed in the U.S. job market are admitted on temporary visas, with no guarantee of renewal. Yet, lottery critics point out, 50,000 people picked in a yearly drawing get the unearned gift of permanent resident status.

Given the threat of terrorism bred abroad, opponents also have expressed concerns that the lottery could be susceptible to fraud.

There have been sporadic attempts by Congress to curtail funding for the lottery, but it has survived.

Contact staff writer Michael Matza at 215-854-2541 or mmatza@phillynews.com.