WASHINGTON – For one day at least, President Donald Trump is getting along great with the U.S. intelligence community – most of them anyway.

In announcing the death of Islamic State leader Abu Bakr al-Baghdadi, Trump praised the work of intelligence officials, a marked departure from his repeated criticism of the intelligence community over the Russia investigation.

"We had some incredible intelligence officials that did a great job," Trump said during remarks Sunday at the White House.

Yet while proclaiming "it's really a deserving name – intelligence," Trump also seemed to take a shot at certain unnamed leaders in what Washington refers to as the "intelligence community."

"I've dealt with some people that aren't very intelligent having to do with intel," Trump said.

More:Trump withheld details of raid from Pelosi, other congressional Democrats

Aaron David Miller, a former State Department official and a senior fellow at the Carnegie Endowment for International Peace, said it's "ironic that several of the things Trump has castigated likely helped secure this victory" – including CIA intelligence, Kurdish cooperation, and the U.S. counterterrorism troop presence in Syria.

Miller said he found Trump's praise of the intelligence community, in particular, to be quite ironic: "It’s the very professional intelligence community that he constantly derides that’s helped him claim credit for killing Baghdadi."

Trump has clashed repeatedly with intelligence officials throughout his presidency, mostly over two high-profile investigations.

One is Russian interference in the 2016 election to benefit the Trump; the other is the ongoing impeachment inquiry that centers on Trump's own dealings with the president of Ukraine.

"When we use our intelligence correctly, what we can do is incredible," Trump told reporters Sunday. "When we waste our time with intelligence that hurts our country, because we had poor leadership at the top, that's not good."

The face of ISIS: Who was Abu Bakr al-Baghdadi?

U.S. in Syria: Soldiers, Bradley armored vehicles in Kuwait eyed for deployment to Syria

Since the election, Trump has periodically questioned the intelligence community's assessment that Russia did indeed seek to influence 2016 in his favor by hacking prominent Democrats and pushing fakes news about candidate Hillary Clinton.

The president has accused Barack Obama-era intelligence officials – such as former Director of National Intelligence James Clapper and former CIA Director John Brennan – of somehow conspiring to pin the Russia plot on him.

Brennan, a frequent critic of Trump, weighed in on Twitter, praising U.S. special operations forces and intelligence personnel for their "courage, skill and dedication."

"Your continued success dismantling terrorist organizations saves countless innocent lives," he tweeted.

In February of 2017, less than a month after his inauguration, Trump tweeted that "the real scandal here is that classified information is illegally given out by 'intelligence’ like candy. Very un-American!”

In May of 2018, Trump claimed on Twitter that "Brennan started this entire debacle about President Trump."Trump and aides have said they suspect Ukraine interfered in the election – one of the topics of the call with Ukraine President Volodymyr Zelensky that is central to the impeachment drive.

House Democrats are investigating whether Trump held up military aid to Ukraine until it agreed to investigate the 2016 election and U.S. Democratic opponent Joe Biden. The probe began after a whistleblower's complaint.

Throughout the process, Trump and his allies have accused the whistleblower of having links to the intelligence community. Democrats have accused Trump of seeking to "out" the whistleblower for political reasons.

On Sunday, both Trump and his critics praised the U.S. intelligence community – the latter group saying it performed well despite past attacks from the commander in chief.

Chris Whipple, author of "The Gatekeepers: How the White House Chiefs of Staff Define Every Presidency," called Trump’s praise “grudging at best.”

He also noted that Trump never used the term “CIA.”

“That’s no coincidence,” Whipple said.

Trump did not mention CIA Director Gina Haspel or acting Director of National Intelligence Joseph Maguire in his initial remarks praising the intelligence community but later thanked both in response to a question about who was involved.

Anti-Trump Republican strategist Rick Tyler said the al-Baghdadi operation "eviscerates his systematic undermining of American intelligence capabilities."

The announcement of al-Baghdadi's death came three weeks after Trump announced the withdrawal of American troops from northern Syria, a move that sparked bipartisan criticism that he had abandoned the Syrian Kurdish forces who fought alongside U.S. forces against the Islamic State, also known as ISIS.