Donald Trump has lashed out at the “fake media”, accusing it of trying to gag him and his supporters during a speech at an evangelical event honoring veterans in Washington.

“The fake media is trying to silence us, but we will not let them,” he said. “The fake media tried to stop us from going to the White House. But I’m president, and they’re not,” he told attendees at the John F Kennedy Center for the Performing Arts.

The president suggested the press “destroyed themselves because they went too far” and told supporters “Their agenda is not your agenda.”

Before taking the podium, he took the rare move of pinning one of his tweets to the top of his feed, one that appeared to shift his slogan from fake news to fraud news.

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

At the Saturday night “celebrate freedom” concert he worked to energize evangelicals in his political base, noting that the US currency was inscribed with the words: “In God we trust.”

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”.

“Since the signing of the declaration of independence 241 years ago, America always affirmed that liberty comes from our creator. Our rights are given to us by God, and no earthly force can ever take those rights away,” he said.

Attendees at the event for veterans waved miniature American flags from their seats in the theater and raised their hands as a sign of praise while a large choir sang ahead of Trump’s remarks.

A choir performed The Battle Hymn of the Republic at the Trump rally. Photograph: Pool/Getty Images

The president praised veterans from each of the US military branches and highlighted his administration’s work to reform veterans’ services.

Trump, who is spending a long weekend at his property in Bedminster, New Jersey, flew back to Washington for the rally but did not spend the night at the White House, preferring to return to Bedminster.