WASHINGTON – Special Counsel Robert Mueller has been investigating a period of time last summer when President Donald Trump seemed determined to drive Attorney General Jeff Sessions from his job, according to people familiar with the matter who said that a key area of interest for the inquiry is whether those efforts were part of a months-long pattern of attempted obstruction of justice.

In recent months, Mueller’s team has questioned witnesses in detail about Trump’s private comments and state of mind in late July and early August of last year, around the time he issued a series of tweets belittling his “beleaguered” attorney general, these people said. The thrust of the questions was to determine whether the president’s goal was to oust Sessions in order to pick a replacement who would exercise control over the investigation into possible coordination between Russia and Trump associates during the 2016 election, these people said.

The issue of Sessions’ tortured relationship with the president reared up again Wednesday morning when the president tweeted: “Why is A.G. Jeff Sessions asking the Inspector General to investigate potentially massive FISA abuse. … Why not use Justice Department lawyers? DISGRACEFUL!”

Sessions usually opts not to respond to such criticism, but in this case he did. Trump’s criticism faulted the attorney general for not more aggressively pursuing claims that the FBI and Justice Department may have misled a foreign surveillance court on a politically sensitive case in the waning days of the Obama administration. Sessions insisted in his statement that he had reacted appropriately by referring the matter to the department’s inspector general for a possible review of how the surveillance case was handled.

“As long as I am the Attorney General, I will continue to discharge my duties with integrity and honor, and this Department will continue to do its work in a fair and impartial manner according to the law and Constitution,” Sessions said in the statement.

It’s no secret in Washington that the relationship between the president and the attorney general has been badly broken for months. The president has repeatedly issued public broadsides, calling Sessions “weak” or criticizing his leadership of the Justice Department, despite the attorney general’s frequent proclamations of devotion to Trump’s agenda on immigration and crime.

Behind the scenes, Trump has derisively referred to Sessions as “Mr. Magoo,” a cartoon character who is elderly, myopic and bumbling, according to people with whom he has spoken. Trump has told associates that he has hired the best lawyers for his entire life, but is stuck with Sessions, who is not defending him and is not sufficiently loyal.

While Sessions has told associates he had been wounded by the attacks, he has also insisted he’s not going to resign, so the cold war continues.

On the anniversary of Sessions’ confirmation earlier this month, senior aides decided to buy Sessions a bulletproof vest with his name emblazoned on it as a gift, according to a person familiar with the matter.

While there is a soap opera element to the drama between the country’s chief executive and chief law enforcement officer, Mueller apparently has decided there are significant issues at stake for the probe into whether the president or others in the White House sought to obstruct justice, according to the people familiar with the matter.

The New York Times has previously reported that Mueller was examining Trump’s efforts in the spring of 2017 to fire Sessions. People familiar with the probe said the special counsel is also examining the period in late July in which the president sought to publicly shame the attorney general into quitting.

Spokesmen for the Justice Department, special counsel and White House declined to comment.

In mid-July, Trump started escalating his public criticisms of Sessions, including angry tweets. Around that time, according to people familiar with internal White House discussions, the president discussed firing Sessions or forcing him out of the Justice Department. Those discussions are of particular interest to Mueller’s investigators, as they seek to determine the president’s intentions, according to a person familiar with the probe.

At the time, a White House adviser told a Washington Post reporter that Trump was “stunned” Sessions had not yet quit. The president, this adviser added, had been hoping the attorney general would be so embarrassed by Trump’s scathing comments that he would leave.

Trump in this period also ordered his then-chief of staff, Reince Priebus, to get a resignation letter from Sessions. It was not his first request for such a letter, but Priebus hesitated, declining to make the request outright. Conservatives rallied to Sessions’ defense, particularly in Congress, and Trump backed down.

Every Cabinet official can be fired by the president at any time for any reason. If Mueller’s team sought to make Trump’s efforts to oust the attorney general part of a pattern of attempted obstruction, it would have to offer evidence showing he had a corrupt motive in doing so – such as changing the direction of the Russia probe.

Trump’s Wednesday criticism seemed to have another intended target at the Justice Department – Inspector General Michael Horowitz. For more than a year, his office has been investigating how the Justice Department and the FBI handled its 2016 probe of Hillary Clinton’s use of a private email server when she was secretary of state. His findings are expected to be made public soon.

Trump’s comments Wednesday seemed to serve a dual purpose – attack Sessions, and urge Horowitz to speed up the release of his findings. The White House and some of Trump’s conservative supporters in Congress have urged the appointment of a second special counsel to conduct a criminal investigation into how senior FBI and Justice Department personnel handled matters related to Clinton.

Justice Department veterans have long worried that Trump’s repeated public attacks on the department and the FBI are undermining the legitimacy of those agencies, which could have lasting damage to federal law enforcement.

“The continued drumbeat of overheated attacks on the Justice Department and the FBI, coming from all corners of the Hill, the media, and elsewhere, can’t help but undermine both morale and the legitimacy of institutions themselves, but today’s tweet is just another drop in an already overflowing bucket,” said Jamil Jaffer, founder of the National Security Institute at the Antonin Scalia Law School at George Mason University. “Of course, the bigger challenge is that if the concerns aren’t legitimate, then we are playing right into the hands of those abroad who wish to undermine these very critical institutions of our democracy.”

The Washington Post’s Matt Zapotosky, Julie Tate and Sari Horwitz contributed to this report.