U.S. President Donald Trump smiles while speaking at the CIA Headquarters in Langley, Virginia, U.S., on Saturday, Jan. 21, 2017. Olivier Douliery | Pool | Bloomberg | Getty Images

Donald Trump traveled to CIA headquarters Saturday to offer reassurance to the workforce after he spent weeks criticizing American intelligence, but his unscripted, self-referential remarks before a wall of stars memorializing fallen officers are drawing criticism, including a pointed denunciation from the agency's recently departed director. "Former CIA Director Brennan is deeply saddened and angered at Donald Trump's despicable display of self-aggrandizement in front of CIA's Memorial Wall of Agency heroes," Nick Shapiro, a former aide to John Brennan at CIA, told NBC News' Andrea Mitchell. Brennan, Shapiro said, believes Trump "should be ashamed of himself." Trump was greeted with cheers by the CIA officers who volunteered to be there to greet him on a Saturday. But the wall of 117 stars in the CIA lobby is a revered place, and presidents who have spoken there tend to do so carefully and with a close attention to their subject — usually the sacrifices of the CIA officers and their families. Trump expressed support for the CIA, but he also veered into political territory, denouncing the news media, boasting about the size of his inaugural crowds, and even discussing his own appraisal of his intellect.

"And then they say, 'Is Donald Trump an intellectual?'" Trump said. "Trust me, I'm like a smart person." A former senior CIA officer told NBC News he was embarrassed, watching the remarks, which he called a "free-wheeling, narcissistic diatribe." More from NBC News Women's March Brings Flood of Pink Hats, Fiery Rhetoric to Washington

Could President Trump Shut Down An Investigation If He Wanted?

Trump Works to Smooth Over Tensions With CIA Visit: 'I Am So Behind You'

Another former senior official noted that that early on in his remarks Trump interrupted himself as he was commenting on the stars behind him and never returned to the topic. "Not quite a `this hallowed ground moment,'" the official said. Former CIA Director Mike Hayden, a Republican who opposed Trump, said in an email, "I was heartened that the President gave a speech at CIA. It would have been even better if more of it had been about CIA." When Barack Obama first visited CIA as president in 2009, he read a speech in which he honored CIA officers and told them he would need their help.