In Donald Trump's first formal response Monday to the Orlando massacre, he said that the attack is a result of the U.S.'s immigration policy.

He also attacked presumptive Democratic nominee Hillary Clinton for her position on guns, immigration and intelligence gathering. Here is a fact check of the statistic-packed speech.

Trump: "When I am elected, I will suspend immigration from areas of the world when there is a proven history of terrorism against the United States, Europe or our allies, until we understand how to end these threats."

Federal law does give the president wide and fairly unilateral authority to restrict immigration.

Under a statute regarding inadmissible aliens, the president is granted the authority to "suspend the entry of all aliens or any class of aliens" whenever the president finds their entry to the U.S. "would be detrimental to the interests of the United States."

Note that Trump used that exact language regarding aliens “detrimental to the interests” of the U.S.

In the modern era, however, immigration policy has been based on policy goals and threat assessments – geography, profiles, etc — not generally protected classes, such as religion or race. If a president sought to institute an immigration ban based on religion, it would be challenged and could be struck down by the Supreme Court.

Trump: "We are importing Radical Islamic Terrorism into the West through a failed immigration system —and through an intelligence community held back by our president. Even our own FBI Director has admitted that we cannot effectively check the backgrounds of the people we are letting into America."

The FBI Director has raised concerns about the difficulty of screening certain potential immigrants, especially from war-torn countries. In Senate testimony last September, for example, he noted that two Iraq refugees were arrested for terrorism related crimes, which suggested "less than excellent vetting." Intelligence officials have raised the same concern about refugees from Syria – in both cases, the U.S. is hampered from obtaining quality crime and security information from the host country itself.

That said, Trump’s statement is a large exaggeration, because it treats the exceptional cases as the norm — the FBI Director has not suggested the U.S. “cannot effectively check the backgrounds of the people we are letting into America” as a general or routine matter. He said it about a subset screening process for refugees from a few countries. Generally, the U.S. conducts extensive screening on a sliding scale based on the host country.

Indeed, security and immigration experts have long stressed that the largest screening and vetting problem is NOT Middle Eastern countries, which generally get stricter screening, but favored countries in the Visa Waiver program, which lets people enter the U.S. for up to three months without obtaining a visa or related screening. It’s a boon to tourism and business, and includes countries like the UK, Belgium, Denmark, France and Germany.

Trump: "Immigration from Afghanistan into the United States has increased nearly five-fold in just one year. According to Pew Research, 99 percent of people in Afghanistan support oppressive Sharia Law."

In 2013, Pew conducted a worldwide survey of Muslims in 39 countries. The percentage of Muslims in Afghanistan who said they favored making sharia the official law in their country was in fact 99 percent.

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

The survey additionally notes that that percentage is far higher in countries that already have laws in place favoring Islam over other religions. In countries like Lebanon, Turkey and Albania, for example, Muslims are far less likely to favor making Sharia official law. The population of Afghanistan is about 99 percent Muslim as a whole, according to a Pew survey in 2012.

It’s also worth noting that those around the world who favored making Sharia the law of their land generally agreed that it should apply only to Muslims.

According to the Department of Homeland Security’s Yearbook of Immigration Statistics, the number of people from Afghanistan who obtained legal permanent resident status did indeed increase significantly between 2013 and 2014. The number in 2013 was 2,196 persons, compared to 10,527 in 2014.

It’s worth noting, though, that that’s about the same population of individuals getting green cards that same year from Brazil, Bangladesh, Burma, Canada, Ecuador, Egypt, Iran, Nigeria and many other countries.

Of course, one reason for the increase in immigration to the United States from Afghanistan is the thousands of interpreters and guides who helped the US military and hoped to move to the US to escape retaliation for aiding the Americans. But many of these individuals have been left in the cold.

From Foreign Policy: “Stingy constraints on Afghan immigration to the United States, even for those who aided the U.S. war effort, are another source of despair. American veterans have taken up the cause of thousands of interpreters and guides seeking visas to escape reprisal at home. Between October 2006 and November 2015, the United States issued only 17,619 visas earmarked for this special category, though many more of these applicants remain in limbo. During this same period, only 5,375 Afghans received visas through conventional channels. Washington remains deeply suspicious of Afghan visa applicants from all walks of life.”

Trump: "Having learned nothing from these attacks, she now plans to massively increase admissions without a screening plan, including a 500 percent increase in Syrian refugees."

The Obama administration has accepted 10,000 Syrian refugees, but the screening process is lengthy. Only 1300 Syrian refugees have come to the U.S. this year.

Clinton has said she'd accept up to 65,000 Syrian refugees, more than the 500 percent increase Trump mentioned. (This post has been corrected to say "more than" 500 percent instead of "far from" 500 percent.)

“I would like to see us move from what is a good start with 10,000, to 65,000, and begin immediately to put into place the mechanisms for vetting the people that we would take in, looking to really emphasize some of those who are most vulnerable,” she said, according to the Wall Street Journal, including "a lot of the persecuted religious minorities, including Christians, and some who have been brutalized, like the Yazidi women.”

Trump: “The Obama Administration, with the support of Hillary Clinton and others, has also damaged our security by restraining our intelligence-gathering and failing to support law enforcement.”

The U.S.'s domestic intelligence gathering capabilities mostly fall under the U.S.A. Patriot Act, which civil liberties proponents say goes too far. As a candidate, Obama said he’d roll back some Patriot Act measures to enhance personal privacy. But since he’s been in office, President Obama has been a proponent of the Act and pushed for its extension, including in an election year — 2012.

Senators Rand Paul and Ted Cruz were among those in Congress who tried to roll back the PATRIOT ACT in 2012.

As for Clinton, she voted for the Patriot ACT in 2001 and 2006. Privacy protections were included in the 2006 renewal.

Trump: "Her plan is to disarm law-abiding Americans, abolishing the 2nd amendment, and leaving only the bad guys and terrorists with guns."

In no way has Clinton proposed to abolish the Second amendment. She has called for background checks, banning assault weapons, and barring those who are on a terror watch list. The conservative-leaning Supreme Court ruled that regulations to gun ownership are not antithetical to the Second Amendment.

Trump: "Large numbers of Somali refugees in Minnesota have tried to join ISIS."

Several Somali-Americans living in Minnesota have been charge with trying to join ISIS as of 2015. At least 14 members of the community of about 25,000 have been arrested since 2014, according to Minnesota Public Radio.