Former New York mayor Rudy W. Giuliani said President Trump wanted a “Muslim ban” and requested he assemble a commission to show him “the right way to do it legally.”

Giuliani, an early Trump supporter who once had been rumored for a Cabinet position in the new administration, appeared on Fox News late Saturday night to describe how Trump's executive order temporarily banning refugees came together.

Trump signed orders on Friday not only to suspend admission of all refugees into the United States for 120 days but also to implement “new vetting measures” to screen out “radical Islamic terrorists.” Refugee entry from Syria, however, would be suspended indefinitely, and all travel from Syria and six other nations — Iran, Iraq, Libya, Somalia, Sudan and Yemen — is suspended for 90 days. Trump also said he would give priority to Christian refugees over those of other religions, according to the Christian Broadcasting Network.

Fox News host Jeanine Pirro asked Giuliani whether the ban had anything to do with religion.

“How did the president decide the seven countries?” she asked. “Okay, talk to me.”

“I'll tell you the whole history of it,” Giuliani responded eagerly. “So when [Trump] first announced it, he said, 'Muslim ban.' He called me up. He said, 'Put a commission together. Show me the right way to do it legally.' "

Giuliani said he assembled a “whole group of other very expert lawyers on this,” including former U.S. attorney general Michael Mukasey, Rep. Mike McCaul (R-Tex.) and Rep. Peter T. King (R-N.Y.).

“And what we did was, we focused on, instead of religion, danger — the areas of the world that create danger for us,” Giuliani told Pirro. “Which is a factual basis, not a religious basis. Perfectly legal, perfectly sensible. And that's what the ban is based on. It's not based on religion. It's based on places where there are substantial evidence that people are sending terrorists into our country.”

It was unclear when the phone call Giuliani took place and when the commission began working. An email to the White House press office was not immediately returned Sunday.

Clips of the exchange between Giuliani and Pirro quickly went viral Saturday night, with some claiming that Giuliani's statement amounted to admitting Trump's intent had been to institute a ban based on religion.

Others, including Trump senior adviser Kellyanne Conway and White House Chief of Staff Reince Priebus, have insisted it is not a ban on Muslims, but rather one based on countries from which travel was already restricted under Barack Obama's administration.

Priebus appeared on CBS's “Face the Nation” Sunday morning to say it was possible Trump would expand the list of countries included in the travel ban.

“You can point to other countries that have similar problems, like Pakistan and others,” Priebus told host John Dickerson. “Perhaps we need to take it further.”

Priebus also said there had been weeks of work and “plenty of communication” between the White House, the State Department and the Department of Homeland Security regarding the ban.

“We didn't just type this thing up in an office and sign up,” he told Dickerson.

Later on the same program, Rep. Keith Ellison (D-Minn.) called out Giuliani's interview with Pirro from the night before.

“They can't deny that this is a Muslim ban,” Ellison told Dickerson. “On the campaign trail, [Trump] said he wanted a Muslim ban. ... Rudolph W. Giuliani who helped him write it said that they started out with the intention of a Muslim ban and then they sort of 'languaged' it up so to try to avoid that label, but it is a religiously based ban.”

Senate Democrats vowed to draft legislation to block the travel ban.

“We’re demanding the president reverse these executive orders that go against what we are, everything we have always stood for,” Senate Minority Leader Charles E. Schumer (D-N.Y.) said in a news conference Sunday morning, noting later that his middle name, Ellis, was originally inspired by Ellis Island.

“It was implemented in a way that created chaos and confusion across the country, and it will only serve to embolden and inspire those around the globe those that will do us harm,” Schumer added of the ban. “It must be reversed immediately.”

Trump's executive order sparked massive protests at airports around the country Friday and Saturday, as reports surfaced that dozens of travelers from the affected countries, including green-card holders, were being detained.

The American Civil Liberties Union filed a lawsuit Saturday morning challenging Trump’s order after two Iraqi men with immigrant visas were barred from entering the United States at New York's John F. Kennedy International Airport.

As Giuliani was speaking, Fox News simultaneously aired an alert that noted federal judge Ann M. Donnelly had issued a stay to stop the deportations nationwide.

Donnelly wrote that there was a strong likelihood the order had violated the petitioners' rights to due process and equal protection by the Constitution.

“There is imminent danger that, absent the stay of removal, there will be substantial and irreparable injury to refugees, visa-holders, and other individuals from nations subject to the January 27, 2017 Executive Order,” Donnelly wrote.

The ACLU hailed the victory.

“Clearly the judge understood the possibility for irreparable harm to hundreds of immigrants and lawful visitors to this country,” ACLU executive director Anthony D. Romero said in a statement. “Our courts today worked as they should as bulwarks against government abuse or unconstitutional policies and orders. On week one, Donald Trump suffered his first loss in court.”

On Sunday, the Department of Homeland Security issued a statement saying it did not plan to back off enforcing Trump's orders.

“President Trump’s Executive Orders remain in place — prohibited travel will remain prohibited, and the U.S. government retains its right to revoke visas at any time if required for national security or public safety,” the statement read. “President Trump’s Executive Order affects a minor portion of international travelers, and is a first step towards reestablishing control over America's borders and national security.”

The department said that less than 1 percent of daily international air travelers to the United States had been “inconvenienced” on Saturday.

Matthew Kolken, an immigration attorney based in Buffalo said there has been “a systemic bias against individuals from Muslim countries in the U.S. immigration departments” for years, including under the Obama administration.

“This isn't unprecedented,” Kolken told The Washington Post by phone Sunday. “The unfortunate reality is the executive branch does have vast discretionary authority to determine who they are going to [allow in or not].”

Still, Kolken said, he believes “Trump has gone a step further without a doubt” in including even people who are lawful permanent residents and suspending all immigration applications from people from the seven countries on the banned list.

If there was evidence of disparate treatment of individuals from the same country — if there were anecdotal evidence of, for example, a Syrian family of one religious background allowed to enter over that of another religious background — then that is where lawsuits could come into play, he said.

“The question becomes whether they're trying to do an end-around by couching the ban as a country-specific ban based on a security-related issues when in reality it's a religious ban,” Kolken said.

Read more:

Fact Checker: What you need to know about terror threat from foreigners and Trump’s executive order

‘I am heartbroken’: Malala criticizes Trump for ‘closing the door on children’ fleeing violence

A ship full of refugees fleeing the Nazis once begged the U.S. for entry. They were turned back.

Trump’s travel ban could make Rex Tillerson’s potential job harder, a former defense secretary says