Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Homeland Security chief John Kelly denied Tuesday that he was blindsided by President Trump’s signing of the controversial United States entry ban that sparked outrage and nationwide protests.

“We did know the executive order was coming,” Kelly said. “We had people involved in the general drafting of it. Clearly this whole approach was part of what then-candidate Trump talked about for a year or two. So we knew all this was coming.”

Retired General John Kelly testifies before a Senate Homeland Security and Governmental Affairs Committee confirmation hearing on Kelly's nomination to be Secretary of the Department of Homeland Security on Capitol Hill in Washington, D.C., on Jan.10, 2017. Joshua Roberts / Reuters

“It wasn’t a surprise that it was coming,” Kelly said.

Kelly was reacting to reports that the first he heard of Trump’s controversial executive order was when another official saw it on the news.

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

A senior administration official told NBC News that Kelly was briefed more than once about the upcoming executive order after his confirmation hearing and prior to Trump's inauguration. Also, Kelly and his senior staff were provided drafts of the order, which were "99 percent" similar to what Trump later signed, the official said.

Kelly on Tuesday also insisted that Trump’s executive order, which halted immigration from seven Muslim-majority countries and imposed an indefinite halt on all refugees from Syria coming to the U.S., was “not a ban on Muslims.”

“Religious liberty is one of our most fundamental and treasured values,” he said. “This is a temporary pause that allows us to better review the existing refugee and visa vetting system.”

Kelly said the seven countries in question — Syria, Iraq, Iran, Yemen, Libya, Somalia and Sudan — don’t have adequate safeguards to prevent terrorists from boarding planes to the U.S.

“It is important to understand that there are terrorists and other bad actors who are seeking to infiltrate our homeland every single day,” he said. “We cannot gamble with American lives … I will not gamble with American lives.”

As Kelly spoke, Massachusetts Attorney General Maura Healey announced that her office was joining the lawsuit filed by the ACLU of Massachusetts challenging Trump’s executive order. Healey said she filed on behalf of two University of Massachusetts Dartmouth professors who were detained at Logan Airport in Boston.

“Harm to our institutions, our citizens, and our businesses is harm to the Commonwealth of Massachusetts,” Healey said in a statement. “The President’s executive order is a threat to our Constitution. Rather than protecting our national security, it stigmatizes those who would lawfully emigrate to our state.”

Protesters chant as they block a road during a demonstration against the immigration ban imposed by President Donald Trump at Los Angeles International Airport on Jan. 29, 2017 in Los Angeles. Thousands of protesters gathered outside of the Tom Bradley International Terminal at Los Angeles International Airport to denounce the travel ban imposed by President Trump. Protests are taking place at airports across the country. Justin Sullivan / Getty Images

A short time later, New York Attorney General Eric Schneiderman — a longtime Trump nemesis — said his office was also joining the lawsuit.

“As I’ve made clear, President Trump’s executive action is unconstitutional, unlawful, and fundamentally un-American,” he said in a statement.

Virginia's Attorney General Mark Herring and Gov. Terry McAuliffe also announced they were joining a separate pending lawsuit against the Trump Administration challenging the executive order.

In Chicago, a Syrian refugee named Fatima who arrived in the Windy City in December pleaded for help for the refugees still stranded in the Middle East.

“We are human beings like all the human beings in all the world,” she said. “We are Muslims and we are not terrorists… Please, please, don’t close your doors to refugee families like me who need your help.”

Some 3 million refugees have been resettled in the U.S. since Congress passed the Refugee Act of 1980, which created the Federal Refugee Resettlement Program and established the current screening and admissions standards.