WASHINGTON — President Donald Trump's embattled national security adviser Michael Flynn resigned late Monday night, following reports that he had misled Vice President Mike Pence and other officials about his contacts with Russia. His departure upends Trump’s senior team after less than one month in office.

In a resignation letter, Flynn said he held numerous calls with the Russian ambassador to the U.S. during the transition and gave “incomplete information” about those discussions to Pence. The vice president, apparently relying on information from Flynn, initially said the national security adviser had not discussed sanctions with the Russian envoy, though Flynn later conceded the issue may have come up.

Trump named retired Lt. Gen. Keith Kellogg as the acting national security adviser. Kellogg had previously been appointed the National Security Council chief of staff and advised Trump on national security issues during the campaign.

The Justice Department warned the Trump administration weeks ago that contradictions between the public depictions and the actual details of the calls could leave Flynn in a compromised position, an administration official and two other people with knowledge of the situation told the Associated Press on Monday night.

One person with knowledge of the situation said the Justice Department alerted the White House that there was a discrepancy between what officials were saying publicly about the contacts and the facts of what had occurred. Pence — apparently relying on information from Flynn — initially said sanctions were not discussed in the calls, though Flynn has now told White House officials that the topic may have come up.

A second official said the Justice Department was concerned Flynn could be in a compromised position as a result.

The White House has been aware of the Justice Department warnings for “weeks,” an administration official said, though it was unclear whether Trump and Pence had been alerted.

The people insisted on anonymity because they were not authorized to discuss the matter publicly. The Washington Post was the first to report the communication between former acting attorney general Sally Yates, a holdover from the Obama administration, and the Trump White House.

Flynn apologized to Pence last week, following a Washington Post report asserting that the national security adviser has indeed discussed sanctions with the Russian envoy.

White House spokesman Sean Spicer said Trump was consulting with Pence on Monday about his conversations with the national security adviser. Asked whether the president had been aware that Flynn might discuss sanctions with the Russian envoy, Spicer said, “No, absolutely not.”

Trump, who comments on a steady stream of issues on his Twitter feed, has been conspicuously silent about the matter since The Washington Post reported last week that Flynn had discussed sanctions with the Russian envoy. A U.S. official told the Associated Press that Flynn was in frequent contact with Ambassador Sergey Kislyak on the day the Obama administration slapped sanctions on Russia for election-related hacking, as well as at other times during the transition.

Flynn’s discussions with the Russian raised questions about whether Flynn offered assurances about the incoming administration's new approach. Such conversations would breach diplomatic protocol and possibly violate the Logan Act, a law aimed at keeping citizens from conducting diplomacy.

Earlier Monday, White House counselor Kellyanne Conway said Trump had “full confidence” in Flynn, though her assertions were not backed up by other senior Trump aides. Spicer would say only that Flynn was continuing to carry out “his daily functions.”

Flynn was spotted near the Oval Office just after 10 p.m. Monday. Amid the uncertainty over Flynn's future, several of the president’s top advisers, including chief of staff Reince Priebus and counsel Don McGahn, ducked in and out of late-night meetings in the West Wing.

Several House Democrats called on Oversight Committee Chairman Jason Chaffetz, R-Utah, to launch an investigation into Flynn’s ties to Russia. House Democratic leader Nancy Pelosi called for Flynn to be fired, saying he “cannot be trusted not to put Putin before America.”

Republican Sen. Susan Collins of Maine said that if Pence were misled, “I can’t imagine he would have trust in General Flynn going forward.” She said it would also be “troubling” if Flynn had been negotiating with a foreign government before taking office.

It’s illegal for private citizens to conduct U.S. diplomacy. Flynn’s conversations also raise questions about Trump’s friendly posture toward Russia after U.S. intelligence agencies concluded that Moscow hacked Democratic emails during the election.

The controversy comes as Trump and his top advisers seek to steady the White House after a rocky start. The president, who seeks input from a wide range of business associates, friends and colleagues, has been asking people their opinions on his senior team.

Advisers have privately conceded that the White House spit out too many disparate messages in the first few weeks, though they also note that the president's own tweets sometimes muddy the day’s plans before most of the White House staff has arrived for work.