President Barack Obama personally warned then-President-elect Donald Trump against hiring Michael Flynn as his national security adviser last fall as Trump began his transition, current and former administration officials said on Monday.

Obama delivered his warning on Nov. 10, two days after the election, when Trump visited the White House and met with Obama in the Oval Office for what both men described at the time as a cordial conversation.

White House press secretary Sean Spicer confirmed the discussion, which was first reported by NBC News, but played down the seriousness of Obama's warning.

“President Obama made it known that he wasn’t exactly a fan of General Flynn’s, which frankly shouldn’t come as a surprise to anyone, given that General Flynn had worked for President Obama [and] was an outspoken critic of President Obama's shortcomings,” Spicer told reporters Monday at his daily briefing.

The revelation about Obama's warning to Trump came on the same day that former acting attorney general Sally Yates testified in Congress that she warned the White House's top lawyer in January that Flynn "was compromised by Russia" and could be blackmailed.

Flynn, a retired lieutenant general, served in the Obama administration as head of the Defense Intelligence Agency and was fired in 2014. He went on to become a top policy adviser to Trump and acted as a prominent surrogate on the campaign trail and in television interviews, harshly attacking Obama and others in his administration.

Trump ignored Obama's advice and tapped Flynn to serve as his national security adviser in the White House, a position he held for just 24 days until he was forced out for having misled Vice President Pence about his private conversations with Russian Ambassador Sergey Kislyak.

“The president took appropriate action when he did, once he felt that General Flynn had misled the vice president,” Spicer said.

Flynn's contacts with Kislyak and connections to the Russian government have been the subject of inquiry by the U.S. government for months.

Spicer sought to pin blame for Flynn's troubles on the Obama administration, telling reporters, “The question that you have to ask yourself, really, is that if President Obama was truly concerned about General Flynn, why didn’t he suspend General Flynn's security clearance, which they had just approved months earlier?”

The warning about Flynn “was not a prepared talking point,” a second former Obama administration official said, meaning it was not a subject that Obama had planned to raise with his successor. But as the two men discussed personnel, Obama expressed caution about putting Flynn in a high-level position. There were multiple reasons, the former official said, including Flynn’s performance leading the DIA, his attendance at the RT event in Moscow, and his controversial statements on Islam.

“There wasn’t certainly at the time the thought that he’s compromised” by his association with Russia, the former official said. “It was more a confluence of red flags.”