President Donald Trump's claims about bad people coming into the United States have expanded to include not just people who get here illegally, but also immigrants who arrive legally after being vetted by the U.S. government.

Trump told graduates at the FBI National Academy that two recent terrorist attacks in New York City were perpetrated by individuals who came to the United States via a "dysfunctional immigration system," one through family sponsorship and the other through the diversity visa lottery program.

Trump said: "They have a lottery. You pick people. Do you think the country is giving us their best people? No. What kind of a system is that? They come in by lottery. They give us their worst people, they put them in a bin, but in his hand, when he’s picking them is, really, the worst of the worst. Congratulations, you’re going to the United States. Okay. What a system — lottery system."

Trump made similar comments on Dec. 20 at a Cabinet meeting: "When we take people in a lottery, they're not putting their best people in the lottery. It's common sense. They're not saying, 'Oh, let's take our best people and let's put them into the lottery so that we can send them over to the United States.' No. They put their worst people into the lottery. And that's what we get in many cases."

Trump’s recent comments parallel his Pants on Fire claim as presidential candidate that the Mexican government sends "the bad ones" over to the United States.

In this case, Trump oversimplified and misconstrued the program. Countries don't send their people. Lottery applicants must meet minimum standards for education or work experience. The lottery is run by the United States, not foreign countries. Lottery winners are selected by a random, computerized process. Individuals must pass background vetting by the U.S. government before getting a visa.

The White House declined to comment on the record for this fact-check.

Trump’s criticism of the diversity visa lottery

Trump favors a merit-based immigration system where people come in based on job skills, not just because of family connections or for diversity purposes.

He’s said the visa lottery "presents significant vulnerabilities to our national security" and has pointed as an example Sayfullo Saipov, from Uzbekistan, who entered the United States in 2010 through the lottery program. Saipov is accused of killing eight people and injuring a dozen other in an October vehicular attack in New York City. He’s pleaded not guilty to murder and terrorism charges.

The visa lottery program was established in 1990 to diversify the United States’ immigrant population. The lottery began in 1995 and selects applicants from countries with low immigration levels during the previous five years. Diversity visas are currently capped at 50,000 per fiscal year.

It's not foreign governments who run the lottery, it's administered by the U.S. State Department. Here’s its current description of the program:

• Applicants register online for the lottery in the fall;

• Names of lottery winners are randomly selected by a computer;

• Lottery winners are notified around May that they can apply for the diversity visa;

• The visa application process and interviews begin Oct. 1. This step includes extensive vetting such as biographic and biometric screening against U.S. law enforcement and counterterrorism databases;

• Applicants who pass the vetting process are awarded the diversity visa, which is usually valid for up to six months from date of issuance.

"No visa can be issued unless all concerns raised by the screening are fully resolved. As part of this screening process, information that might suggest an individual is a potential threat is shared with all appropriate U.S. government agencies," the State Department said in a statement to PolitiFact.

"National security is our top priority when adjudicating visa applications," the agency added.

The ‘worst of the worst’?

Trump’s comment that the worst are coming not only ignores vetting done by the State Department, but also lottery entry requirements of at least a high school education or its equivalent, 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.

"In countries where only a fraction of people complete secondary school, this basic criterion limits the pool of people eligible for the diversity lottery significantly," said Beth Elise Whitaker, an associate professor of political science at the University of North Carolina at Charlotte.

Trump said countries are not "giving us" their best people. But that's a flawed statement.

Countries do not "give" immigrants, noted Elizabeth F. Cohen, an associate professor of political science at Syracuse University.

"Individuals make decisions to apply for any visa, including but not limited to the diversity lottery visa. The decision is a difficult one, as is the process of receiving the visa," Cohen said. "The application and vetting process are also complicated, suggesting that only highly capable and well-prepared individuals will succeed."

Cohen said Trump and his administration have promoted two conflicting goals: They have attacked family reunification immigration policies, but also the diversity lottery, "which does not rely on family reunification and is far more skills-based than the name suggests."

"The diversity visa program is a true lottery. There is no way a foreign government can game the lottery to offload the worst of their citizenry," Stephen Yale-Loehr, a professor of immigration law practice at Cornell Law School wrote in an op-ed for the New York Daily News.

Our ruling

Trump said of the diversity visa lottery program, "they give us their worst people, they put them in a bin," and "the worst of the worst" are selected.

Trump based his criticism of the lottery program on the fact that the suspect in a New York City terror attack came through the program in 2010.

But Trump’s simplistic characterization gives a misleading impression of how the process actually works. First of all, countries don't "give us" immigrants. The lottery is administered by the United States, not foreign governments.

Lottery entrants must meet educational and work experience requirements, and winners are chosen at random by a computer. Also, winning the lottery does not necessarily mean the person will come to the United States. They must be thoroughly vetted before being awarded a visa.

We rate Trump’s statement Pants on Fire.