WASHINGTON - US President Donald Trump Saturday visited the Central Intelligence Agency on a mission to reassure the intelligence community that they have his full support but he soon veered off course to attack the “dishonest media” in an unusual political speech in front of national-security professionals.

Standing in front of the wall of stars carved into marble to represent each of the 117 CIA agents who have died in service to the country, Trump, in his first official engagement at the spy agency's Langley Headquarters, lashed out at his critics, boasted of his appearances on magazine covers and exaggerated about the size of the crowd at his inauguration on Friday.

"Honestly it looked like a million and half people, whatever it was it was. But it went all the way back to the Washington Monument ... and by mistake I get this network and it showed an empty field, and it said we drew 250,000 people. Now that's not bad, but it’s a lie," Trump said.

Trump also denied having a "feud" with the intelligence community, blaming it on "dishonest" media and vowing to strongly support intelligence officials.

“As you know I have a running war with the media,” Trump said. “They are among the most dishonest human beings on earth. And they sort of made it sound like I had a feud with the intelligence community. And just want to let you know that that the reason you’re the No. 1 stop is exactly the opposite.”

He also hinted at loosening rules on torture put in place under President Barack Obama, promised to wipe “radical Islamic terrorism… off the face of the earth” and pledged his full backing to the CIA. “I am so behind you,” Trump said, adding, “You’re gonna get so much backing. Maybe you’re gonna say, please, don't give us so much backing, Mr. President, please, we don’t need that much backing.”

Trump’s comments, delivered without the aid of a teleprompter, oscillated jarringly between wanting to entertain, reassure, brag and attack.

Roughly 400 CIA employees attended the speech, for which there had been an open invitation. The self-selected crowd repeatedly interrupted Trump cheering and clapping. But the appearance rubbed some in the intelligence community the wrong way.

"The proper way to do it was wait for [incoming CIA director Mike] Pompeo to get confirmed, to do it on a weekday, to do it for the larger CIA population but to make it private and answer questions," one former CIA officer was quoted as saying in Politico, a conservative website. "This was a waste of time."

“Former CIA Dir Brennan is deeply saddened and angered at Trump's despicable display of self-aggrandizement in front of CIA's Memorial Wall of Agency heroes. Brennan says that Trump should be ashamed of himself,” Brennan’s former deputy chief of staff, Nick Shapiro, said on Twitter.

Trump, who also met briefly with senior agency leaders before his remarks, reveled in the friendly crowd before him. “Probably almost everybody in this room voted for me,” he claimed at one point. "But I will not ask you to raise your hands.”

“I can only say that I am with you 1,000 percent. And the reason you’re my first stop—” Trump said before dramatically changing direction, “— is that as you know I have a running war with the media. They are among the most dishonest human beings on earth. Right? And they sort of made it sound like I have this feud with the intelligence community.”

The feud was not the media’s creation. Trump had compared the intelligence community’s leaks about him to “Nazi Germany” on Twitter, and then repeated that charge in a news conference 10 days ago. He also used so-called scare quotes to cite the “intelligence” agencies on Twitter.

On Saturday, Trump made sure to praise the incoming director of the CIA, Congrfessman Mike Pompeo, who is expected to be confirmed to the position on Monday, saying he was the top graduating student at his class at West Point and “essentially number one at Harvard Law School.”

Trump, who endorsed bringing back torture during the campaign, also said at the CIA that he would destroy the Islamic State. “We have not used the abilities that we have,” he said. “We’ve been restrained.” Trump repeated another campaign line — about how the United States should have taken the oil when it invaded Iraq — and said, “maybe you’ll have another chance,” without further explanation. Trump went on to boast about how many covers of Time magazine he has appeared on.

And then he singled out a Time magazine reporter, by name, for making a reporting error about a bust of Martin Luther King, Jr., being removed from the Oval Office on Friday, for which the reporter has already publicly apologized.

Trump also touted his intellect in a brief aside. “Is Donald Trump an intellectual? Trust me, I’m like a smart person,” he said. Trump’s unusual appearance earned the quick rebuke of Congressman Adam Schiff, the top Democrat on the House Intelligence Committee. “He will need to do more than use the agency memorial as a backdrop if he wants to earn the respect of the men and women who provide the best intelligence in the world,” Schiff said.