Mr. Stone said he decided to leave; Mr. Trump maintained that he fired him.

As an informal adviser, Mr. Stone supported Mr. Trump’s plan to focus extensively on immigration at the start of the 2016 campaign, and believed that he could tap into a core group of disaffected Republican voters. He encouraged his engagement with conservative online media, such as Newsmax and, later on, Breitbart. He also advised Mr. Trump to attack Mrs. Clinton over how she dealt with women involved in her husband’s extramarital affairs, a line of attack that Mr. Trump embraced. Mr. Trump offered praise for Mr. Stone on the coming Netflix documentary “Get Me Roger Stone.”

These days he will not discuss how frequently he is in touch with Mr. Trump, or whether he has visited the Oval Office since the inauguration — which he attended dressed according to what he described as “proper etiquette”: a top hat and morning suit. The White House press secretary, Sean Spicer, told reporters in the briefing room on Monday that Mr. Trump and Mr. Stone speak “from time to time,” and he contended they had not done so recently.

To both his allies and critics, Mr. Stone, a native of Connecticut, presents a contradictory portrait. His name inspired anxiety in a generation of New York political operatives. He has embraced theories that Mr. Trump pushed in the campaign about Senator Ted Cruz’s father somehow being tied to the John F. Kennedy assassination. And once a week he guest-hosts on a radio show hosted by Alex Jones, who has a devoted following of Trump voters along with a raft of conspiracy theories of his own.

On Monday, when he devoted most of his show to defending Mr. Stone, Mr. Jones expressed concern that Mr. Stone’s life was in danger — a reference to Mr. Stone’s claim that he was recently poisoned with polonium as well as the victim of a “suspicious” hit-and-run broadside car crash last week. Mr. Stone did not let that keep him from an event in Orlando to promote his book the following day.

But Mr. Stone is also a libertarian and strong supporter of gay rights and legalized marijuana who expressed concern in 2016 that Mr. Trump’s campaign team didn’t try harder to get him to disavow the Ku Klux Klan leader, David Duke. While he has long been an outlier in the political world, he got his real start in national politics with the Reagan campaign in 1979. He is renowned among Republican political professionals for using the internet for years before “any mainstream Republicans or activists,” according to Tony Fabrizio, a veteran Republican pollster.

And for a time, as a partner in a white-shoe Washington lobbying firm, Mr. Stone was a part of the swamp that Mr. Trump now wants to drain. He worked there with his old friend, Paul Manafort, who was Mr. Trump’s campaign chairman. His ties to Russia are now under scrutiny by the F.B.I., but Mr. Manafort denies any suggestion that he colluded with Russian officials or anybody else.

But those establishment days seem far in the past. As scrutiny of him has intensified in recent weeks, Mr. Stone has lashed out more aggressively, sending a series of caustic, obscenity-laced messages on Twitter, several of which he deleted a few hours after posting.

“Don’t confuse Roger Stone with the character I play,” Mr. Stone said with a chuckle in an interview on Sunday, conceding that he has sometimes sent a “two-martini tweet.”