"When he first announced it he said, 'Muslim ban,'" the former New York mayor told Fox News late Saturday when asked whether the ban was connected to religion.
"Show me the right way to do it legally," Giuliani -- who Trump has tapped as his cyber security guru -- said the US president told him.
The 72-year-old said he and a team of legal experts "focused on -- instead of religion -- danger!" when they drafted the immigration crackdown that has sparked a global outcry and mass protests.
Trump's sweeping executive order, signed Friday, suspends the arrival of refugees for at least 120 days and prohibits issuing visas for travelers from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen for the next three months.
Giuliani said those predominantly Muslim countries were targeted because they are "the areas of the world that create danger for us."
The crackdown on Muslim immigration has infuriated civil rights groups and activists.
A federal judge blocked Saturday part of Trump's ban, ordering authorities not to deport refugees and other travelers detained at US airports.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)