Mr Flynn is alleged to have discussed US sanctions with the Russian ambassador before Mr Trump took office.
He is said to have misled officials about the conversation.
Earlier, US media reported that the Justice Department had warned the White House about the contacts late last month.
They said that Mr Flynn might be vulnerable to Russian blackmail.
Senior Democrats had called for Mr Flynn to be fired.
It is illegal for private citizens to conduct US diplomacy, and the calls happened late last year before Mr Flynn was appointed to the administration.
In his letter of resignation, Mr Flynn said he had "inadvertently briefed the vice-president-elect and others with incomplete information regarding my phone calls with the Russian ambassador".
A White House statement said Gen Joseph Keith Kellogg had been appointed as interim replacement.
Mr Flynn, a retired Army lieutenant general, initially denied having discussed sanctions with the ambassador, and Vice-President Mike Pence publicly denied the allegations on his behalf.
However, Mr Flynn later told the White House they may have been discussed.