An Iranian student who was denied entry to the United States on arrival and deported this week, amid objections from top Democrats and left-wing activists, has family ties to the Iranian Revolutionary Guard Corps and Lebanon-based terror group Hezbollah, a Department of Homeland Security official told Fox News.

Mohammad Shahab Dehghani Hossein was denied entry to the U.S. and detained on Sunday when he arrived on a student visa at Boston Logan International Airport.

His detention sparked outrage from activists, who flooded the airport demanding his release. It also drew objections from Northeastern University, where Dehghani was due to be enrolled, and the American Civil Liberties Union (ACLU).

DHS BOSS WARNS CARAVAN MIGRANTS WILL BE SENT HOME IF THEY REACH US, AMID REPORTS OF VIOLENCE

"Shahab Dehghani is an Iranian student with a valid F1 visa, returning to finish his education. CBP already held him overnight,” Sen. Elizabeth Warren, D-Mass. tweeted. “His deportation must be halted, and we must fight the Trump administration's xenophobic policies."

A Massachusetts district court judge granted Dehghani a stay from deportation, but Customs and Border Protection (CBP) deported him minutes later -- a DHS official told Fox News Wednesday that he had already been put on the plane when the stay was issued.

In a statement Tuesday, CBP said that “the issuance of a visa ... does not guarantee entry to the United States” and said that Dehghani had been “deemed inadmissible and processed for expedited removal and return to his place of departure.

“During today’s hearing, the court ruled that the matter is now moot as the subject was never admitted into the United States, the subject is no longer in custody, and the court does not have jurisdiction to order his return,” the statement said.

A CBP spokesperson said that the agency was not at liberty to discuss an individual’s case due to the Privacy Act, but noted that “CBP officers are charged with enforcing not only immigration and customs laws, but they also enforce over 400 laws for 40 other agencies and have stopped thousands of violators of U.S. law. “

ICE SUBPOENAS NY FOR INFO ON ILLEGAL IMMIGRANT ACCUSED OF MURDER, AS SANCTUARY CITY FIGHT ESCALATES

The outrage from that deportation was fierce, both from activists and Democrats. Warren, along with fellow Massachusetts Democrats Sen. Ed Markey and Rep. Ayanna Pressley, penned a furious letter Thursday to Acting CBP Commissioner Mark Morgan expressing concern about what they described as a “pattern” of officials targeting Iranian students for additional inspections -- particularly the Dehghani case.

Protesters stand outside the federal courthouse where a hearing was scheduled for Northeastern University student Shahab Dehghani, Tuesday, Jan. 21, 2020, in Boston. Dehghani arrived on a flight into Boston on Monday but was detained by U.S. Customs and Border Patrol at Logan International Airport and then was deported. (AP Photo/Philip Marcelo)

Protesters stand outside the federal courthouse where a hearing was scheduled for Northeastern University student Shahab Dehghani, Tuesday, Jan. 21, 2020, in Boston. Dehghani arrived on a flight into Boston on Monday but was detained by U.S. Customs and Border Patrol at Logan International Airport and then was deported. (AP Photo/Philip Marcelo)

That letter blasted CBP’s “outrageous” actions in the Dehghani matter, particularly that he was deported minutes after the stay was issued: “This is shameful, irresponsible, and completely unacceptable."

But the DHS official, speaking to Fox News, said that the case was more complicated than some were letting on, and that there were legitimate reasons for rejecting Dehghani. Specifically, the official told Fox News that Dehghani’s family has links to the IRGC -- of which Gen. Qassem Soleimani, who was recently killed in a controversial U.S. strike, was a member -- and to terror group Hezbollah. That claim, first reported by WBUR News, focuses on his family's association with a company sanctioned by the U.S. for its terror ties.

That company was sanctioned by the Obama administration in 2010, when the Treasury Department identified the company as having been used by the IRGC to support terrorist activities outside of Iran -- namely in support of Hezbollah.

Mohammad Shahab Dehghani Hossein

Mohammad Shahab Dehghani Hossein

The DHS official also said there was information that Dehghani himself had recently been in Iraq. There was no information provided on what it was believed Dehghani was doing there. Meanwhile, a government official told The New York Times that Dehghani was the administrator of a YouTube channel called “Islamic Pulse,” which called for reprisals against the U.S. for Soleimani’s death.

For many, such ties would be a slam dunk for denying a foreign national entry into the U.S., particularly given the ongoing concerns about reprisal attacks from Iran as well as concerns about sleeper agents from groups such as Hezbollah within the U.S.  Last month, Lebanese-born Ali Kourani was sentenced to 40 years in prison for his work as an operative for the Islamic Jihad Organization -- Hezbollah’s attack-planning component. Officials said Kourani, who came to the U.S. in 2003, had conducted surveillance on infrastructure, airports and even daycare centers within New York City in preparation for possible attacks.

But Democratic lawmakers were undeterred by the concerns raised about Dehghani. In their letter, Pressley, Warren and Markey brushed off the claims by arguing that while there are reported “familial” connections” to terror groups, there is no alleged connection involving Dehghani himself, and they note that he underwent background and security checks as part of the visa process.

"Nor do these allegations justify deporting Mr. Dehghani in violation of a stay of removal form a federal judge," the letter says. It also notes that Dehghani’s lawyers have called the claims against Dehghani baseless.

“I find it really hard to believe that something that obvious slipped by the Department of State for a year,” Kerry Doyle, one of the lawyers, told the Times. Doyle did not return a request for comment from Fox News.

CLICK HERE TO GET THE FOX NEWS APP

The DHS official noted to Fox News that Dehghani had not merely been denied entry to the U.S., but that officials had taken the extra step of revoking Dehghani’s visa, rather than allowing him to voluntarily withdraw the application. The official said that the move, which bars Dehghani from getting another visa for five years, is an indication of the seriousness with which the connections were treated by CBP officials.