Michael Flynn has resigned as national security adviser over his contact with Russian officials before US President Donald Trump took office.

His resignation on Tuesday followed reports a day earlier that the Department of Justice warned the Trump administration weeks ago that such communications could leave him in a compromised position.

AL JAZEERA'S WASHINGTON EDITOR JAMES BAYS: This is very important news and very worrying news for the Trump administration. This is, number one, a most important job. He is the gatekeeper, the man who tells the president about the world. He's the person who connects the key agencies of the United States - the State Department, the Pentagon, all the intelligence agencies - to the White House. It's an absolutely key job and he's going less than a month into the presidency, but it's even more damaging for Donald Trump. This is his longest-serving policy adviser. Trump went through a couple of campaign managers throughout the campaign, he's had a change of staff. Outside the family, the man who's been with President Trump the longest is Flynn. It's a very damaging blow for the White House. That's because not only is he losing a key member of staff, but because of the fact he's resigned in these circumstances. Remember that this is a situation that is under investigation - hacking by Russia of the United States during a presidential election. Flynn talked to the Russians about that very subject, it seems, and talked about the idea of lifting sanctions. The fact that Flynn goes does not mean that inquiries end. This saga is not over.

It is illegal for private citizens to conduct US diplomacy.

"Unfortunately, because of the fast pace of events, I inadvertently briefed the Vice President-elect and others with incomplete information regarding my phone calls with the Russian ambassador," Flynn wrote in his official resignation letter.

"I am tendering my resignation, honoured to have served President Trump, who in just three weeks has reoriented American foreign policy in fundamental ways to restore America's leadership position in the world," he added.

Retired General Keith Kellogg, who has been chief of staff of the White House National Security Council, was named the acting national security adviser while Trump determines who should fill the position.

Discussing sanctions

Flynn's departure less than one month into the Trump administration marks an extraordinarily early shake-up in the president's senior team of advisers.

Flynn was a loyal Trump supporter throughout the campaign, but his ties to Russia caused concern among other senior aides.

Flynn initially told Trump advisers that he did not discuss sanctions with Sergey Kislyak, Russia's ambassador to the United States, during the transition.

Vice President Mike Pence, apparently relying on information from Flynn, publicly vouched for the national security adviser.

Flynn later told White House officials that he may have discussed sanctions with the ambassador.

His conversations raise questions about Trump's friendly posture towards Russia after US intelligence agencies concluded that Moscow hacked Democratic emails during the election.

'Looseness with the truth'

A US official on Monday told The Associated Press that Flynn was in frequent contact with Kislyak on the day the Obama administration slapped sanctions on Russia for the election-related hacking, as well as at other times during the transition.

Flynn's discussions with the Russian also raised questions about whether he offered assurances about the incoming administration's new approach.

Oh the irony of this clip now #flynn https://t.co/7mWVGW8tOt — Mehdi Hasan (@mehdirhasan) February 14, 2017

Such conversations would breach diplomatic protocol and possibly violate the Logan Act, a law aimed at keeping citizens from conducting diplomacy.

Mark Jacobson, a Democratic adviser to former Secretary of Defense Ash Carter, told Al Jazeera: "This is not about the conversations [Flynn] had with the Russian ambassador or other Russian diplomats. This was about the way he characterised it to the vice president, plain and simple."

"Charges have never been brought against anyone based on the Logan Act. I'm less concerned about that, I'm more concerned about the fact he may have lied to the vice president," Jacobson added.

"It's more of the cover-up that gets you here. There's been a lack of transparency, there has been a looseness with the truth at this White House."

' Russophobia'

A senior Russian MP said Flynn's resignation suggested Trump had been backed into a corner or that his administration had been "infected" by anti-Russian feeling.

"Either Trump has not gained the requisite independence and he is consequently being not unsuccessfully backed into a corner, or Russophobia has already infected the new administration also from top to bottom," MP Konstantin Kosachev was cited as saying by the RIA Novosti news agency.

Kosachev is head of the upper house of parliament's international affairs committee.

OPINION: Why is Russia so happy with Trump?

Moscow-based Dmiitry Babich, a reporter at the state-funded Sputnik International news agency, told Al Jazeera the news signalled "a dangerous return of McCarthyism to American politics.

"It's obvious that the special services of the United States who eavesdropped on that conversation between Michael Flynn and the Russian ambassador, they leaked this information," he said.

"That was used to remove a person from office for a very strange reason. Isn't it natural that the future head of national security should talk to an ambassador of a foreign nation, not a hostile nation, about the possible removal of sanctions?"