In his resignation letter, he admitted he had “inadvertently briefed the vice president-elect and others with incomplete information regarding my phone calls with the Russian ambassador”.
Mr Flynn said he had “sincerely apologized to the President and the Vice President, and they have accepted my apology”.
Former president Barack Obama imposed sanctions on Russia over its annexation of Crimea and claims it tried to influence the US election.
Mr Flynn’s resignation – just three weeks into the new administration – comes amid claims he discussed sanctions with Moscow’s US envoy Sergey Kislyak late last year before Mr Trump was in power – and before he had officially taken up his own role.
Under the Logan Act in American law, it is illegal for an unauthorised citizen to conduct diplomacy on behalf of the US.
A US official has also confirmed a Washington Post report that former acting attorney general Sally Yates – who Mr Trump fired in January after she defied him over his controversial travel ban – had warned the White House last month that Mr Flynn could be vulnerable to Russian blackmail over his early contact with the ambassador.
Mr Flynn initially told Vice President Mike Pence he had not discussed sanctions during the meeting with Mr Kislyak, prompting Mr Pence to defend him in a TV interview.
In recent days however, Mr Flynn, the former head of the Defense Intelligence Agency (DIA), the Pentagon’s spying arm, admitted he might have raised the subject of sanctions with the Russians but said he could not be 100% certain.
The three-star lieutenant-general who was forced to retire as the director of the DIA in 2014 by the Obama administration, sat beside Vladimir Putin at a December 2015 Moscow banquet headlined by the Russian President.
A lifelong Democrat, Mr Flynn was a vocal and loyal supporter of Mr Trump throughout his presidential campaign.
I highly recommend the just out book – THE FIELD OF FIGHT – by General Michael Flynn. How to defeat radical Islam.
— Donald J. Trump (@realDonaldTrump) July 23, 2016
He famously called for Hillary Clinton to be arrested, leading chants of “lock her up!” during a Republican Convention, and in February 2016, he tweeted “fear of Muslims is RATIONAL”.
Mr Flynn was appointed to Mr Trump’s top team less than two weeks after the billionaire’s election to office.
Mr Trump then hailed him “an invaluable asset to me and my administration”, and months earlier had recommended Mr Flynn’s book, The Field Of Fight: How We Can Win the Global War Against Radical Islam and its Allies.
Mr Flynn’s resignation comes hours after the White House said it was “evaluating” the situation, and following Mr Trump’s close aide, Kellyanne Conway, telling reporters the security adviser’s job was safe.
Retired lieutenant general Joseph Kellogg will take up the role until a permanent successor is appointed.
The former CIA director and retired general, David Petraeus, is under consideration for the role, according to a White House official.
Another contender for the position is Robert Harward, a retired Navy Seal, who served on the National Security Council for president George W Bush and commissioned the National Counter Terrorism Center.