Former Trump campaign aide Sam Nunberg said Tuesday he will cooperate with the special counsel Robert Mueller in the Russia investigation after being subpoenaed last week.

Nunberg stunned observers and legal analysts Monday when he melted down during a media blitz.

He said he would not cooperate with Mueller's "witch hunt" and that he did not believe he would go to jail for defying Mueller's subpoena.

But Nunberg changed his mind about cooperating after receiving free legal advice from MSNBC panelist and lawyer Maya Wiley on air Monday evening.

Sign up for the latest Russia investigation updates here.

Sam Nunberg, a former aide to President Donald Trump's campaign, told The Washington Post Tuesday that he will cooperate with the special counsel Robert Mueller — based on advice he received Monday evening from a panelist on a cable news show.

The statement marks a significant departure from comments Nunberg made during an impromptu media blitz on Monday, when he called Mueller's subpoena "absolutely ridiculous" and said he would not cooperate with a "witch hunt" that could harm the longtime Republican strategist and Trump adviser Roger Stone, whom Nunberg sees as his "mentor."

Axios reported early Tuesday that Nunberg had anonymously provided the subpoena to reporter Jonathan Swan over the weekend. According to Swan's reporting, Mueller's office asked Nunberg to hand over all of his communications with 10 witnesses, including Trump, Stone, Carter Page, Corey Lewandowski, Hope Hicks, Paul Manafort, Rick Gates, and Steve Bannon.

Nunberg said Monday that "Trump caused" the Russia investigation "because he's an idiot" and that he would not turn over his communications with people like Hicks, whom he "despises." He added that he did not believe he would go to jail if he defied Mueller's subpoena.

On Tuesday, Nunberg said he changed his mind after receiving advice on the air from attorney Maya Wiley, who used to serve as New York City Mayor Bill de Blasio's chief counsel.

Wiley was one of three lawyers, including host Ari Melber, who appeared with Nunberg on MSNBC Monday evening. But the interview soon turned into an impromptu legal counsel session.

"What you're essentially projecting to me as an attorney is that you're actually protecting [Stone] because there's something to protect," Wiley said.

When Nunberg complained that the subpoena meant he had to spend "80 hours" going through documents and communications to hand over to Mueller, Wiley said, "You'd rather spend possibly a year in jail than 80 hours going through documents?"

"I think your family wants you home for Thanksgiving, and I think you should testify," she added.

Nunberg praised Wiley during his interview with The Post on Tuesday.

"She's very, very smart," he said. "She made a compelling case to me, and the case was that they have to do this for their investigation, and it was a fair point."

Nunberg's attorney, Patrick Brackley, did not know about his Monday media blitz in advance, Nunberg told CNN.

In addition to calling Trump an idiot and slamming Hicks, Nunberg also went after White House press secretary Sarah Huckabee Sanders.

"If she wants to attack me, I can attack her back," he said.

He continued during his later interview with Melber: "I'm warning her to shut her mouth."

And while Nunberg said during an interview with MSNBC's Katy Tur that he believes Trump's campaign had not colluded with the Russian government, he hinted that Mueller may have found other incriminating charges.

"I think they may. I think that he may have done something during the election, but I don't know that for sure," he said.