Former New York City Mayor Rudy Giuliani denied any role in crafting President Trump's travel ban, which contradicts the former mayor's previous comments on national television.

Giuliani's role in crafting the ban was a topic of debate in the first arguments over the legality of the ban before the 9th Circuit Court of Appeals. Surrogates' remarks about Muslims and the immigration ban, alongside Trump's comments as a candidate, president-elect and president, remain a hot-button issue in the litigation.

In an affidavit filed with the U.S. District Court for the Southern District of New York this week, Giuliani said he had no role in creating the ban and his consulting firm had no role in representing the Trump administration.

"In particular I have not served on any Trump administration commission 'relating to the so-called Muslim Ban Executive Orders,'" Giuliani wrote. "For clarity, I have not participated in writing any of the executive orders on that subject issued by the Trump administration."

In January, Giuliani told Fox News that Trump asked Giuliani to help the president find a legal way to execute the ban.

"[Trump] called me up, he said, "Put a commission together, show me the right way to do it legally,"" Giuliani told Fox News in January. "I put a commission together ... and what we did was we focused on, instead of religion, danger. The areas of the world that create danger for us."

Trump's original travel ban barred people from seven majority-Muslim countries from entering the U.S. for 90 days, blocked all refugees for 120 days and banned Syrian refugees indefinitely. After that order was blocked by the courts, and sparked protests around the country, Trump revised the order, banning citizens of six Muslim countries from entering the U.S. It also lifted the ban on Syrian refugees.

Giuliani continued to say on national television his commission's actions provided the basis for Trump's ban.