President Donald Trump once used the 2015 attack in San Bernardino, California, to argue for a ban on Muslim entry to the US. Now, after an attack that killed eight people in Lower Manhattan Tuesday, he’s arguing that US immigration policy (and Senate Minority Leader Chuck Schumer) is partially responsible.

Police say Sayfullo Saipov, the 29-year-old suspect, plowed a rented pickup truck into pedestrians and cyclists on a busy bike path Tuesday afternoon. Initially, Trump blamed the attack on “a very sick and deranged person,” offered his “condolences and prayers,” and tweeted vaguely about ordering “Homeland Security to step up our already Extreme Vetting Program.” (It wasn’t clear, exactly, what he actually meant — and the White House hasn’t followed up.)

But Wednesday morning — apparently inspired by Fox & Friends — the president went on the offensive, lambasting the “Diversity Visa Lottery Program,” which he described as a “Chuck Schumer beauty.” Trump claimed that the suspect, who came to the United States from Uzbekistan legally in 2010, entered the country through this particular 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

He continued:

We are fighting hard for Merit Based immigration, no more Democrat Lottery Systems. We must get MUCH tougher (and smarter). @foxandfriends — Donald J. Trump (@realDonaldTrump) November 1, 2017

"Senator Chuck Schumer helping to import Europes problems" said Col.Tony Shaffer. We will stop this craziness! @foxandfriends — Donald J. Trump (@realDonaldTrump) November 1, 2017

Details about Saipov’s background are still trickling out, and Trump didn’t provide any additional information about how the suspect arrived in the United States. At the time it wasn’t clear if Trump was just repeating unconfirmed reports — a local ABC affiliate first reported Saipov entered through the visa program, but according to the Washington Post, that hasn’t been officially corroborated. But the Department of Homeland Security acknowledged later Wednesday that Saipov did enter the U.S. through the diversity visa program.

The “diversity visa lottery” was created to bring in Irish and Italian immigrants

The program Trump referred to, the “Diversity Visa Lottery Program” (officially called the Diversity Immigrant Visa, or DV, Program), awards visas to people from countries that tend to have historically low immigration rates to the United States.

The program is part of the Immigration and Nationality Act, signed in 1990 by Republican President George H.W. Bush after bipartisan support in Congress.

What about Schumer? The Washington Post explains that the diversity program did come out of a bill that the then-representative introduced in 1990, which eventually wrapped into the larger immigration act signed that year.

Anna O. Law, a political science professor at CUNY Brooklyn College who studies US immigration and constitutional law, noted on Twitter that the program originated through an effort by senators and representatives with large Irish and Italian constituencies. At the time, Law said, “‘old seed’ immigrant groups were being shut out by newer groups from Asia and Latin America”:

The program was created by powerful and well placed Italian and Irish American Senators and Reps to help their co-ethnics immigrate. 2/ — Anna O. Law (@UnlawfulEntries) November 1, 2017

It was pork barrel legislation designed to benefit very specific groups. The lottery was created w/ a formula to make eligible only 7/ — Anna O. Law (@UnlawfulEntries) November 1, 2017

persons from nations who had sent a small # of peeps to the US; it obviated the need for family ties/job skills. The "diversity" language 8/ — Anna O. Law (@UnlawfulEntries) November 1, 2017

was window dressing and branding to sell it. Was politically smarter a label than a visa for "peeps with no family ties or job skills." 9/ — Anna O. Law (@UnlawfulEntries) November 1, 2017

The program is limited to 50,000 visas each year. While Irish immigrants were prioritized early on, in recent years, the majority of its recipients arrive from Africa and Eastern Europe. According to the State Department, no particular country will get more than 7 percent of available diversity visas each year.

Schumer didn’t remain a supporter of the program forever. As Arizona Sen. Jeff Flake pointed out, the “Gang of Eight” immigration reform bill — which passed the Senate in 2013 but was doomed in the House — would have eliminated the program, and Schumer happened to be part of that Gang of Eight:

Actually, the Gang of 8, including @SenSchumer, did away with the Diversity Visa Program as part of broader reforms. I know, I was there https://t.co/QQFJzPyRzC — Jeff Flake (@JeffFlake) November 1, 2017

This isn’t the first time Trump has opposed the visa lottery, either. The RAISE Act — short for Reforming American Immigration for Strong Employment, a bill to lower legal immigration sponsored this summer by Sens. Tom Cotton (R-AR) and David Perdue (R-GA), and backed by Trump — would also eliminate it.

Update: This post has been updated to reflect the Department of Homeland Security’s confirmation that Saipov entered the U.S. through the diversity visa program.