WASHINGTON (AP) — President Donald Trump vowed to support and defend religious liberty, telling a gathering of evangelical Christians that the threat of terrorism is "one of the most grave and dire threats to religious freedom in the world today."

President Donald Trump speaks during the Celebrate Freedom event at the Kennedy Center for the Performing Arts in Washington, Saturday, July 1, 2017. Associated Press/Carolyn Kaster President Donald Trump slammed the "dishonest media" Saturday night during a speech honoring veterans, following up on multiple attacks he had lobbed at the press earlier in the day via Twitter.

"The fake media tried to stop us from going to the White House, but I'm president and they're not," he said.

"The fact is the press has destroyed themselves because they went too far. Instead of being subtle and smart, they used a hatchet."

In his speech, Trump also vowed to support and defend religious liberty, telling a gathering of evangelical Christians that the threat of terrorism is "one of the most grave and dire threats to religious freedom in the world today."

"We cannot allow this terrorism and extremism to spread in our country, or to find sanctuary on our shores or in our cities," Trump said.. "We want to make sure that anyone who seeks to join our country shares our values and has the capacity to love our people."

The evangelical megachurch First Baptist Dallas and Salem Media Group sponsored the event at the John F. Kennedy Center for the Performing Arts. First Baptist Pastor Robert Jeffress was a strong backer of Trump during the 2016 campaign.

The event at times felt like one of Trump's signature campaign rallies, with the president promising an adoring crowd that America would "win again."

Trump appeared on a stage decorated with a massive American flag. Choirs performed "The Battle Hymn of the Republic" and other hymns and debuted a song with the lyrics "make America great again" — Trump's campaign slogan.

Besides speaking to the event's religious theme, Trump renewed his campaign promise to always take care of America's veterans.

"Not only has God bestowed on us the gift of freedom, he's also given us the gift of heroes willing to give their lives to defend that freedom," he said.

Overwhelming support from evangelical voters helped propel Trump to victory in 2016. Since he took office, Christian conservatives have been overjoyed by Trump's appointment of Justice Neil Gorsuch to the Supreme Court and his executive order ordering the IRS to ease up on a rarely enforced limit on partisan political activity by churches.

Trump was spending the pre-Independence Day weekend at his golf club in Bedminster, New Jersey, but traveled back to Washington for the event.