WASHINGTON — President Barack Obama warned Donald J. Trump against hiring Michael T. Flynn to be part of his national security team when Mr. Obama met with his successor in the Oval Office two days after the November election, two former Obama administration officials said on Monday.

Mr. Obama, who had fired Mr. Flynn as the head of the Defense Intelligence Agency, told Mr. Trump that he would have profound concerns about Mr. Flynn becoming a top national security aide, said the administration officials, who were briefed on the Oval Office conversation. Mr. Trump later ignored the advice, naming Mr. Flynn to be his national security adviser.

Mr. Flynn was forced out of that position after it was revealed that he had lied to Vice President Mike Pence about his conversations with the Russian ambassador to the United States, amid a continuing investigation into connections between the Russian government and the Trump campaign.

Mr. Obama and Mr. Trump met for the first time in the Oval Office on Nov. 10 in what both men later described as a cordial, 90-minute session in which the outgoing president pledged to do everything he could to support the transition to a new administration.