Updated

A federal computer programming error has prompted the U.S. State Department to void the results of the visa lottery.

That means major disappointment for tens of thousands of would-be immigrants from around the world who were notified this year that they had won a chance to come and live legally in the United States.

Nearly 15 million people had entered the 2012 lottery hoping to win one of 50,000 U.S. immigrant visas available under a wild-card program for people who otherwise would have little hope of getting a coveted U.S. visa.

Applicants for the random drawing do not have to have the usual family or employer sponsor.

The lottery selects 90,000 winners, a total that is then winnowed down through attrition, interviews and strict educational and occupational criteria.

More On This...

The software glitch caused what is supposed to be a random drawing to select 90 percent of winners from entries submitted on only the first two days of the 30-day registration period that ended Nov. 3, the department said on Friday.

"These results are not valid because they did not represent a fair, random selection of the entrants as required by U.S. law," said David Donahue, the deputy assistant secretary of state whose office oversees the lottery. "We sincerely regret any inconvenience or disappointment this problem might have caused."

The problem stemmed from an in-house programming error that has now been fixed, he said. A new lottery will be held from the existing pool of entries with winners announced in mid-July. Applicants do not need to re-enter to be eligible to win the do-over and no new entries will be accepted, he said.

Donahue recorded an online video to explain the situation and the State Department has updated its visa diversity lottery webpage to inform entrants that the previous results had been discarded.

The diversity visa lottery was established by Congress in 1994 to increase the number of immigrants coming to the United States from the developing world and countries with traditionally low rates of immigration to the U.S. Citizens of most countries are eligible, however, with those from only 19 countries that have sent more than 50,000 immigrants to the U.S. in the previous five years not allowed to participate.

The ineligible countries are Brazil, Britain, Canada, China, Colombia, the Dominican Republic, Ecuador, El Salvador, Guatemala, Haiti, India, Jamaica, Mexico, Pakistan, Peru, the Philippines, Poland, South Korea and Vietnam. Persons born in the Northern Ireland, the Chinese territories of Hong Kong and Macau as well as Taiwan are eligible.

The lottery has been conducted entirely electronically for the past 15 years and the department said this year is the first time it has encountered a problem. It blamed a data coding error in a new computer program for the mistake.

Between Oct. 5 and Nov. 3, 2011, 14.7 million entries were received. But the glitch caused the overwhelming majority of the winning entries to be chosen from those submitted on Oct. 5 and 6, the department said.

The now-invalidated results became available online on May 1 and about 1.9 million people checked to see if they had won before the problem was uncovered on May 5.

Of those who looked up their status, about 22,000 were informed erroneously that they had been selected to move to the next step in the process, the department said.

Those told they had won were not necessarily in or en route to the United States unless they were here or arriving on another type of visa, officials said. Winning the lottery means the entrant is eligible to go the next step in the process, which can take months to complete.

This is based on a story by the Associated Press.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino