WASHINGTON — For years, President Trump has used Twitter as his go-to public relations weapon, mounting a barrage of attacks on celebrities and then political rivals even after advisers warned he could be creating legal problems for himself.
Those concerns now turn out to be well founded. The special counsel, Robert S. Mueller III, is scrutinizing tweets and negative statements from the president about Attorney General Jeff Sessions and the former F.B.I. director James B. Comey, according to three people briefed on the matter.
Several of the remarks came as Mr. Trump was also privately pressuring the men — both key witnesses in the inquiry — about the investigation, and Mr. Mueller is examining whether the actions add up to attempts to obstruct the investigation by both intimidating witnesses and pressuring senior law enforcement officials to tamp down the inquiry.
Mr. Mueller wants to question the president about the tweets. His interest in them is the latest addition to a range of presidential actions he is investigating as a possible obstruction case: private interactions with Mr. Comey, Mr. Sessions and other senior administration officials about the Russia inquiry; misleading White House statements; public attacks; and possible pardon offers to potential witnesses.
None of what Mr. Mueller has homed in on constitutes obstruction, Mr. Trump’s lawyers said. They argued that most of the presidential acts under scrutiny, including the firing of Mr. Comey, fall under Mr. Trump’s authority as the head of the executive branch and insisted that he should not even have to answer Mr. Mueller’s questions about obstruction.
But privately, some of the lawyers have expressed concern that Mr. Mueller will stitch together several episodes, encounters and pieces of evidence, like the tweets, to build a case that the president embarked on a broad effort to interfere with the investigation. Prosecutors who lack one slam-dunk piece of evidence in obstruction cases often search for a larger pattern of behavior, legal experts said.
The special counsel’s investigators have told Mr. Trump’s lawyers they are examining the tweets under a wide-ranging obstruction-of-justice law beefed up after the Enron accounting scandal, according to the three people. The investigators did not explicitly say they were examining possible witness tampering, but the nature of the questions they want to ask the president, and the fact that they are scrutinizing his actions under a section of the United States Code titled “Tampering With a Witness, Victim, or an Informant,” raised concerns for his lawyers about Mr. Trump’s exposure in the investigation.
A spokesman for Mr. Mueller’s office declined to comment.
Mr. Trump’s lead lawyer in the case, Rudolph W. Giuliani, dismissed Mr. Mueller’s interest in the tweets as part of a desperate quest to sink the president.
“If you’re going to obstruct justice, you do it quietly and secretly, not in public,” Mr. Giuliani said.
Mr. Giuliani was referring to more typical obstruction cases, where prosecutors focus on measures taken in private, like bribing witnesses, destroying evidence or lying under oath. While some of Mr. Trump’s private acts are under scrutiny, like asking Mr. Comey for loyalty, his public conduct is as well. That sets this investigation apart, even from those of other presidents; Richard M. Nixon and Bill Clinton were accused of privately trying to influence witness testimony.
But as in those cases, federal investigators are seeking to determine whether Mr. Trump was trying to use his power to punish anyone who did not go along with his attempts to curtail the investigation.
If Mr. Mueller opts to tailor a narrative that the president tried to obstruct the Russia investigation, he would have to clear several hurdles to make a strong case. He would need credible witnesses (Mr. Comey and Mr. Sessions have been the target of concerted attacks by Mr. Trump and allies, undercutting their standing) and evidence that Mr. Trump had criminal intent (the special counsel has told the president’s lawyers he needs to question him to determine this).
“There’s rarely evidence that someone sits down and says, ‘I intend to commit a crime,’ so any type of investigation hangs on using additional evidence to build a narrative arc that hangs together,” said Samuel W. Buell, a professor of law at Duke University and former senior federal prosecutor. “That’s why a prosecutor wants more pieces of evidence. You need to lock down the argument.”
It is not clear what Mr. Mueller will do if he concludes he has enough evidence to prove that Mr. Trump committed a crime. He has told the president’s lawyers that he will follow Nixon- and Clinton-era Justice Department memos that concluded that a sitting president cannot be indicted, Mr. Giuliani has said. If Mr. Mueller does not plan to make a case in court, a report of his findings could be sent to Congress, leaving it to lawmakers to decide whether to begin impeachment proceedings.
Investigators want to ask Mr. Trump about the tweets he wrote about Mr. Sessions and Mr. Comey and why he has continued to publicly criticize Mr. Comey and the former deputy F.B.I. director Andrew G. McCabe, another witness against the president. They also want to know about a January episode in the Oval Office in which Mr. Trump asked the White House counsel, Donald F. McGahn II, about reports that Mr. McGahn told investigators about the president’s efforts to fire Mr. Mueller himself last year.
Mr. Trump has navigated the investigation with a mix of public and private cajoling of witnesses.
Around the time he said publicly last summer that he would have chosen another attorney general had he known Mr. Sessions was going to recuse himself from the Russia investigation, Mr. Trump tried behind closed doors to persuade Mr. Sessions to reverse that decision. The special counsel’s investigators have also learned that Mr. Trump wanted Mr. Sessions to resign at varying points in May and July 2017 so he could replace him with a loyalist to oversee the Russia investigation.
After Mr. Trump tried last July to get Mr. Sessions to resign, the president began a three-day public attack on a variety of fronts — tweets, a Rose Garden news conference and a Wall Street Journal interview — criticizing Mr. Sessions, raising the specter that he would fire him.
A day later, Mr. Trump doubled down, criticizing both Mr. Sessions again and Mr. McCabe, who was the acting F.B.I. director at the time.
Similarly, Mr. Trump’s relationship with Mr. Comey was strained from the start by the president’s encroachment on the typically independent Justice Department. In late March of 2017, the president asked Mr. Comey to put out word that he was not under investigation. Mr. Comey demurred, and when the president called about two weeks later to ask again, Mr. Comey responded that he had passed along the proposal to the Justice Department, he later testified.
That request having gone nowhere, Mr. Trump issued an indirect threat the next day about Mr. Comey’s job. “It’s not too late” to ask him to step down as F.B.I. director, he said in an interview with Maria Bartiromo on Fox Business Network. The special counsel wants to ask the president what he meant by that remark.
A few weeks later, in early May, an aide to Mr. Sessions sought derogatory information about the F.B.I. director. Mr. Sessions, his aide told a Capitol Hill staff member, wanted one negative article a day in the news media about Mr. Comey, a person familiar with the meeting has said.
Four days later, Mr. Trump fired Mr. Comey, citing at first his management of the investigation of Hillary Clinton’s use of a private email server to handle classified information.
By the fall, Mr. Comey had become a chief witness against the president in the special counsel investigation, and Mr. Trump’s ire toward him was well established. His personal attacks evolved into attacks on Mr. Comey’s work, publicly calling on the Justice Department to examine his handling of the Clinton inquiry — and drawing the special counsel’s interest.
Mr. Mueller’s deputies told Mr. Trump’s lawyers they also wanted to question the president about similar statements at the time by the White House press secretary, Sarah Huckabee Sanders.
“The Department of Justice has to look into any allegations of whether or not something is illegal or not,” Ms. Sanders said at a press briefing last September. “That’s not up to me to decide. What I’ve said and what I’m talking about are facts. James Comey — leaking of information, questionable statements under oath, politicizing an investigation — those are real reasons for why he was fired.”
Mr. Trump’s lawyers have pushed back against the special counsel about the tweets, saying the president is a politician under 24-hour attack and is within his rights to defend himself using social media or any other means.
The president continues to wield his Twitter account to pummel witnesses and the investigation itself, ignoring any legal concerns or accusations of witness intimidation. This week, he moved to strip the security clearances of six former senior national security officials, including Mr. Comey, Mr. McCabe and some of his most outspoken critics. And he tweeted false claims about the Russia investigation.