(CNN) The author of President Donald Trump's controversial travel ban , which targeted people from six-majority Muslim countries, is the principal speechwriter for the President's speech on Islam in Saudi Arabia on Sunday.

Both are topics Miller has spoken out against throughout his career on Capitol Hill and in the White House.

The official said the speech has been put together through a collaborative process inside the White House, but that Miller was the primary author.

The speech, which will be given in front of about 50 Muslim leaders, could be a flashpoint in Trump's eight-day, five country trip . Trump has long derided Islam, proposed banning all Muslim immigration into the United States during the campaign and is expected to use the term "radical Islamic terrorism" throughout the speech in Saudi Arabia, the cradle of the 1.6 billion-member religion.

His travel ban, in the name of protecting the US against terrorism, also specifically targeted all Muslim-majority countries, a move that was derided by Muslims everywhere, including in the Middle East.

That ban was the work of Miller, a 31-year-old aide who, along with Trump's chief strategist Steve Bannon, the former Breitbart CEO, has been a key voice in Trump's ear on immigration.

Miller himself has a lengthy history with anti-Muslim rhetoric. During his time at Duke University, Miller wrote extensively for the school's newspaper, including one article in which he wrote : "Islamic terrorists ... have declared a death sentence on every man, woman and child living in this country."

Miller also worked as a college student for the Terrorism Awareness Project, an effort founded by the David Horowitz Freedom Center. The group is considered an anti-Muslim hate group by the Southern Poverty Law Center.

Prior to working with Trump, Miller worked as a top aide and speechwriter to Alabama Sen. Jeff Sessions, who is now Trump's attorney general. Sessions was outspoken on terrorism during Miller's time on his staff, mimicking Miller's views on the faith.

Trump has called his first foreign trip "crucial," despite the fact the trip couldn't come at a worst time for the President: His administration is currently consumed by the naming of a special counsel by the Justice Department to look into Russia's connections to the Trump campaign during the 2016 election.

Trump said earlier this week that he will "challenge" Muslims in Saudi Arabia to "fight hatred and extremism and embrace a better future of their faith."

"We have to stop radical Islamic terrorism," he added.

H.R. McMaster, Trump's national security adviser, said Trump's speech will be "inspiring but direct" and urge the leaders to "confront radical ideology."

"The President hopes for a peaceful vision of Islam to dominate across the world," McMaster said. "The speech is intended to unite the broader Muslim world against common enemies of all civilization and to demonstrate America's commitment to our Muslim partners."

CNN's Daniel Burke contributed to this report.