Investigative journalism created the conditions for Michael Flynn's resignation from his national security adviser post.

Journalists at The Washington Post, The New York Times and other outlets spoke with government officials who provided vital information about Flynn's contacts with Russia.

The sources insisted on anonymity, making it difficult to ascertain their agendas. But the sources caused journalists to dig for more and more details about Flynn's calls. One story became 10 stories, and 10 became a hundred.

"The only reason we're finding out about it now is because a patriot did leak this to The Washington Post, did get this information out there, or else we wouldn't even have known about it," Joe Scarborough said on MSNBC on Tuesday morning.

Evan Osnos of The New Yorker tweeted, "The Flynn story is a reminder of a big truth: Journalism lives. And principled public servants who got the story out are hidden heroes."

Another Trump administration critic, The Atlantic senior editor David Frum, wrote, "Tonight's resignation reminds both why patriots should cherish a free & independent press -- and why Donald Trump so fears & hates it."

Related: Flynn resigns amid controversy over Russian contacts

The tone on Fox News was strikingly different. Steve Doocy, co-host of the pro-Trump "Fox & Friends" morning show, asked, "Whatever happened to secrets in Washington?" Conservative talk show host Laura Ingraham explicitly criticized the leakers.

Monday night's developments may further heighten tensions between the president and the press. Editors at outlets like The Post remain concerned about Trump's attacks on the media and the possibility of leak investigations and prosecutions.

Sean Spicer, the White House press secretary, is slated to hold a briefing at 1 p.m. ET Tuesday. He will surely be asked about the Flynn controversy and who knew what when.

It all started more than a month ago, on January 12, when the Trump transition team was preparing to move into the White House.

Washington Post columnist David Ignatius cited a single "senior U.S. government official" while reporting that "Flynn phoned Russian Ambassador Sergey Kislyak several times on Dec. 29, the day the Obama administration announced the expulsion of 35 Russian officials as well as other measures in retaliation for the hacking."

Ignatius asked: "What did Flynn say, and did it undercut the U.S. sanctions?"

He said the Trump transition team did not respond to his request for comment.

Three days later, Vice President Mike Pence told John Dickerson on CBS' "Face the Nation" that Flynn and the ambassador had not discussed "anything having to do with the United States' decision to expel diplomats or impose censure against Russia." Pence said he had spoken to Flynn directly about it.

There were a number of followup stories, joined by noisy speculation about Flynn's contacts. But further investigation was needed to get to the bottom of it.

Last Thursday, The Post cited "nine current and former officials" in a story headlined "National security adviser Flynn discussed sanctions with Russian ambassador, despite denials, officials say."

The New York Times quickly matched the story and said there was a transcript of the discussions.

The chronology suggests that some officials in the government sought to alert the public to Flynn's contacts by leaking to the press.

Toward the end of the day on Friday, President Trump surprised members of the press corps by saying he had not seen the Post's bombshell report.

Related: Flynn's resignation doesn't end controversy

While speaking with journalists on Air Force One, Trump was asked about it, and he said, "I don't know about that. I haven't seen it. What report is that? I haven't seen that. I'll look into that."

Some commentators found that very hard to believe.

Over the weekend and into Monday, pressure mounted, with inquiries from reporters and constant chatter from television commentators.

Trump aides found themselves without firm answers.

In a 4 p.m. interview on Monday, Trump senior adviser Kellyanne Conway said Flynn had the president's "full confidence." One hour later, Spicer said something much less confident -- that the president was "evaluating" Flynn.

On Tuesday's "Today" show, Matt Lauer asked Conway whether she was "out of the loop," and she said, "No, not at all. Both were true. The president is very loyal, he's a very loyal person, and by night's end Mike Flynn had decided it was best to resign. He knew he'd become a lightning rod."

On CNN's "New Day," Republican congressman Chris Collins of New York said Flynn "did what he thought was in the best interests of the country" by resigning, and "I think it's just time to move on."

Anchor Chris Cuomo responded: "Congressman, there is zero chance we are going to move on" until the White House answers the outstanding questions about the matter.