In the wake of the horrific Egyptian mosque attack that killed more than 300 people, President Trump took to Twitter to both offer his sympathies and plug some favorite policies.

Trump's reasoning seems to be that a wall on the U.S.-Mexico border will keep Muslim extremists from crossing into the United States. That claim echoes those made by current and former members of the Trump administration.

Michael Flynn, the former Army general who was an adviser to the Trump campaign and the president's first national security adviser, told Breitbart News in August 2016 that Islamist terrorist groups have cut deals with Mexican cartels to access smuggling routes into the United States.

And in 2015, when White House Chief of Staff John F. Kelly was still serving as a Marine Corps general and as commander of U.S. Southern Command, he told Congress that Mexican cartels “could unwittingly, or even wittingly, facilitate the movement of terrorist operatives or weapons of mass destruction toward our borders.”

But is the risk real?

In a word: “No.” That's what Christopher Wilson, deputy director of the Mexico Institute at the Woodrow Wilson International Center for Scholars, told the Texas Tribune when the outlet asked him about this last year. “The Texas-Mexico border is not particularly vulnerable to terrorism.”

Other experts agree. “I haven't seen this as a method that terrorists have regularly used,” Daveed Gartenstein-Ross, a senior fellow at the Foundation for Defense of Democracies, told PolitiFact. “There are more efficient ways to get in where you don't have to violate U.S. law.”

The numbers bear that out. In the first nine months of 2016, Border Patrol apprehended 1,004 people trying to cross into the United States illegally from “special interest” countries with active terrorist groups such as Afghanistan, Iran, Iraq, Pakistan and Syria. The vast, vast majority of those apprehended were from Pakistan and Bangladesh. Just 172 were not from those two countries. And of those 172, just nine came from places labeled as state sponsors of terrorism. (It's worth noting, too, that there's no evidence people crossing from “special interest” countries are necessarily terrorists.)

Prototypes for President Trump's promised border wall on the U.S.-Mexico border are on display as his administration still attempts to fund the project. (Reuters)

Homeland Security Committee Chairman Michael McCaul (R-Tex.) told the Texas Tribune there's “hardly any evidence” of terrorists crossing over the southwestern border. “The bad news,” he continued, “is they have the opportunity as long as our border is open.” According to one 2015 report, just a handful of people with ties to Islamic terrorist organizations have ever been caught crossing the U.S.-Mexico border.

It's worth noting, too, that the Muslim extremists who have perpetrated terrorist attacks in the United States were either second-generation immigrants, like Omar Mateen, whose assault on Pulse night club in Orlando killed 49, or else in the United States legally, like the men who perpetrated the 9/11 attacks.

It is also worth noting, however, that there is some indication that the Islamic State has at least considered getting into the United States from Mexico. In one of their magazines, Islamic State fighters imagine smuggling a nuclear device from Pakistan to South America, then transporting it north across the border. “From there it’s just a quick hop through a smuggling tunnel and … presto, they’re mingling with another 12 million ‘illegal’ aliens in America with a nuclear bomb in the trunk of their car,” the 2015 article explains.

When asked about this, Obama administration officials then called it “speculative,” saying that they don't have a “ton of credible, validated intelligence that suggests that ISIS is trying to exploit specific routes” in the United States. He and others noted that since 1995, Customs and Border Protection has spent more than $2.5 billion setting up radiation detection at all points of entry into the country. Officials say they can scan nearly 100 percent of all truck cargo and cargo carried by private vehicles.

Experts and officials have warned that vigilance is important. And they've pointed out that the Canadian border — nearly three times as long and significantly less secure — may actually pose the bigger threat. Just 2,000 Border Patrol agents are stationed along that border, compared with the 18,000 in the South.

According to the Daily Beast, seven monthly reports from 2014 to 2016 show that more people on the terrorist watch list tried to enter the United States from Canada then Mexico. “We are looking the wrong direction,” said a senior DHS official familiar with the data told the outlet. “Not to say that Mexico isn’t a problem, but the real bad guys aren’t coming from there — at least not yet.”

President Trump wants the wall to stop drugs from entering the United States, but the majority of drugs are smuggled through legal ports of entry. (Meg Kelly/The Washington Post)