Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump announced Wednesday he was "starting the process of terminating the diversity lottery program" that he said allowed the suspected New York City attacker to enter the United States legally, and that he would ask Congress to "get rid" of the program immediately.

"We want a merit-based program where people come into our country based on merit," Trump told reporters.

But what is the program, exactly, that allowed Sayfullo Saipov, 29, to immigrate to the United States from Uzbekistan seven years ago?

Here’s what you need to know.

What is it?

Saipov entered the U.S. via the State Department's diversity immigrant visa program, which Trump incorrectly called the "Diversity Visa Lottery Program."

The terrorist came into our country through what is called the "Diversity Visa Lottery Program," a Chuck Schumer beauty. I want merit based. — Donald J. Trump (@realDonaldTrump) November 1, 2017

A spokesman for the Department of Homeland Security confirmed Saipov had been admitted to the U.S. "upon presentation of a passport with a valid diversity immigrant visa to U.S. Customs and Border Protection in 2010."

What are the eligibility requirements?

There are two requirements, according to the State Department.

First, the applicant must be a native of a qualifying country — in other words, a country that has had less than 50,000 natives immigrate to the U.S.

The second requirement is the applicant must have completed high school or "two years of work experience within the past five years in an occupation that requires at least two years of training or experience to perform," according to the State Department.

How are applicants selected?

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Visa applicants are selected through a random, computer-generated lottery. Applicants also have a short window to submit an application on the State Department's website. For the 2019 fiscal year, applicants must complete the application between Oct. 18 and Nov. 22 of this year.

The visas are distributed among six geographic regions and no single country may receive more than seven percent, according to the State Department.

What's the vetting process?

Those selected through this program must go through all of the same background checks and screening processes as any other immigrant visa applicant to be granted admission, including document presentation, background checks, in person interviews and medical exams.

How many people can get a diversity visa?

The U.S. makes 50,000 diversity immigrant visas available each year. According to the State Department, 45,664 diversity visas were issued in 2016.

Last year, 2,378 people from Uzbekistan received diversity visas, a number in line with previous years dating back to 2007, according to State Department statistics.

In 2010, the year Saipov entered the U.S., diversity immigrant visas were just over 10 percent of the total immigrant visas issued (though this does not include non-immigrant visas, like those issued to tourists). That year, 49,771 diversity immigrant visas were issued, the department's statistics showed.

Why does the U.S. have this program in the first place?

Trump in a tweet seemed to blame the program's existence on Senate Minority Leader Chuck Schumer, calling it a "Chuck Schumer beauty."

But its origins stem from the 1990 Immigration and Nationality Act, which was signed by Republican President George H.W. Bush.

President George H.W. Bush talks with Secretary of State James Baker during a Cabinet meeting at the White House on Wednesday, Jan. 31, 1990 in Washington. Barry Thumma / AP file

Schumer, then representing New York in the House, introduced an immigration bill with a section for diversity immigrant visas for countries with low rates of immigration to the U.S.

The bill, including the diversity visas, then morphed in an another House immigration bill, which was co-sponsored by Schumer, 24 other Democrats and seven Republicans. The bill passed the Senate and House in an overwhelmingly bipartisan manner. Bush signed it November 1990 and it went into effect in 1995.

What has happened to the program since?

The program has been largely untouched since its enactment, according to the Congressional Research Service.

However, in 2013, a bipartisan group of senators, including Schumer, known as the "Gang of Eight" proposed a compromise immigration reform bill that would have eliminated the diversity lottery. The bill did not make it through Congress.

What the concerns about the program?

GOP lawmakers have long criticized the program as a threat to national security, a view reiterated by Sen. Tom Cotton, R-AR, on Wednesday. Cotton is supporting a proposal that would drastically reduce legal immigration.

According to a 2007 Government Accountability Report, the State Department's Inspector General under President George W. Bush raised concerns in 2003 that immigrants from countries that sponsor terrorism can apply for diversity visas.

However, the GAO said, "we found no documented evidence that [diversity visa] immigrants from these, or other, countries posed a terrorist or other threat."