Washington (CNN) President Donald Trump on Wednesday tweeted that the 29-year-old Uzbek national suspected of killing eight people in a suspected terrorist attack in New York City the day before is a recipient of a "diversity visa," reigniting a long-simmering debate about immigration in the US.

Lesser known than traditional ways of immigrating into the country like family or work ties, the program benefits up to 50,000 people per year from countries with lower levels of immigration to the US.

"The terrorist came into our country through what is called the 'Diversity Visa Lottery Program,' a Chuck Schumer beauty," Trump tweeted on Wednesday. "I want merit based."

Minutes later, he added : "We are fighting hard for Merit Based immigration, no more Democrat Lottery Systems. We must get MUCH tougher (and smarter)."

What is it?

The Diversity Immigrant Visa Program awards up to 50,000 individuals per year a visa for a green card, which bestows permanent residency in the US and is a path to citizenship.

Opponents of immigration complain that the program brings people to the US to compete for jobs, and even supporters of immigration acknowledge the program does not tailor applicants to needs in the US.

Visas are awarded by random selection in select countries to promote immigration from places that don't otherwise send many immigrants to the US.

Roughly 1 million green cards are issued by the US per year. In 2016, 45,664 diversity visas were issued. The vast majority of green cards are based on family connections, and other categories include employment-based visas and refugees or asylees.

How does it work?

Individuals in countries that are determined by a formula to have a low enough level of immigration to the US can apply for the visas at certain times each year. Most of the lottery recipients live outside the US, but a few are in the US legally on other visas.

According to the formula set out by law , countries that have had more than 50,000 natives immigrate to the US in the previous five years are ineligible.

The visas are distributed further by regions: Africa, Asia, Europe, North America (other than Mexico), Oceania and South America, Mexico, Central America and the Caribbean.

The program is run by the State Department.

While individuals are selected for visas randomly, they still must meet security and eligibility requirements that all immigrants must clear to actually get their visas.

Diversity recipients specifically must also have at least a high school education or equivalent and must have had at least two years of experience working a job that requires at least two years of training or experience within five years of the date of the application. They must also be admissible to the US -- categories of inadmissibility to the US broadly include terrorism connections.

The process also includes an in-person interview.

"In order to immigrate, DV selectees must be admissible to the United States," a State Department information handout for applicants states. "The DS-260, Online Immigrant Visa and Alien Registration Application, electronically, and the consular officer, in person, will ask you questions about your eligibility to immigrate under U.S. law. These questions include criminal and security related topics. "

How did it get started?

The program was established in a bill passed in 1990, the Immigration Act. Senate Minority Leader Chuck Schumer -- then a New York congressman -- was one of 31 co-sponsors of the House version of the bill, spearheaded by Rep. Bruce Morrison, a Connecticut Democrat.

Schumer was credited with the concept of giving visas to countries with low admission rates to the US, which he developed in a different bill that he sponsored that was rolled into the broader law.

Morrison also promoted the bill as a way to legalize Irish immigrants, according to a 1990 report in The New York Times and an analysis of the development of the program from the group NumbersUSA, which advocates for sharp cuts in overall immigration.

The final bill passed the Senate 89-8 and the House 264-118.

Has Congress tried to change the program?

In 2013, Schumer helped author the Gang of Eight bill that passed the Senate by a wide margin, which would have replaced the program.

The Gang of Eight measure was the result of a bipartisan effort to secure comprehensive immigration reform and had included senators such as Florida Republican Marco Rubio and South Carolina Republican Lindsey Graham. The bill died in the House.

The bill would have moved the diversity visas elsewhere in the system and introduced a merit system that took into account multiple factors like family and work skills.

"Actually, the Gang of 8, including @SenSchumer, did away with the Diversity Visa Program as part of broader reforms. I know, I was there," tweeted Arizona Republican Sen. Jeff Flake on Wednesday in response to Trump.

"When re-evaluating immigration policy, it is right to give priority, through a point system or otherwise, to those who have skills and abilities unique to the new economy," Flake wrote in a recent op-ed . "We did this in 2013, in the bipartisan immigration bill that passed the Senate. But there must always be a place in America for those whose only initial credentials are a strong back and an eagerness to use it."

What is Trump proposing?

Republican Sens. Tom Cotton and David Perdue have introduced a bill, endorsed by Trump, that would eliminate the diversity lottery and certain categories of family-based green cards, and then would transform the remaining employment-based visas into a point system that favors heavily highly skilled, highly educated, English-speaking immigrants.

But while there is consensus around needing to reform the process, limited support exists even within the GOP for Cotton and Perdue's bill.

The Cotton-Perdue bill would roughly halve the number of green cards overall per year, a point of contention for many Democrats and Republicans alike, and wouldn't easily allow for low skilled immigrants to come to the US permanently, another sticking point for many.