Less than two weeks on the job, the interim U.S. attorney for Washington, Timothy J. Shea, has stepped into the middle of a political firestorm.

Taking over an office that is overseeing high-profile cases involving President Trump’s friends, self-declared enemies and former advisers — including Roger Stone, former acting FBI director Andrew McCabe and former national security adviser Michael Flynn — Shea has played a central role in the crisis over whether the White House has interfered with the independence of the Justice Department’s prosecutions.

Questions about Shea’s role broke open this week in a controversy surrounding the sentencing recommendation for Stone, one of Trump’s longtime friends.

Shea, 59, had his name attached to the initial recommendation of front-line prosecutors of a seven- to nine-year prison term for Stone that enraged the president as well as to a second version less than 24 hours later that called the first recommendation “excessive.”

Under fire over whether the Justice Department undercut the sentencing recommendation to appease the president, Attorney General William P. Barr pinned responsibility on Shea.

In an interview with ABC News on Thursday, Barr denied the decision to reverse course resulted from the president’s Twitter tirade and instead said Shea — formerly one of his closest advisers at the Justice Department — had initially signaled to him that the recommendation would be about half the time that the line prosecutors ended up requesting. Shea’s boss said he had been “very surprised” by the stiffer suggested penalty.

Now Shea faces fierce criticism over his role in the Stone sentencing debacle and his ability to lead the nation’s largest U.S. attorney’s office, which handles some of the most sensitive, significant and politically charged cases in the Justice Department. If Shea was aware of his prosecutors’ initial sentencing recommendation for Stone and failed to explain it to Barr, Shea failed as a manager, detractors said. If he failed to defend the initial recommendation and folded because of political pressure, he lacks the independence required to serve as U.S. attorney, critics said.

“[Shea] must resign. Otherwise, he is either not in charge of his own office or is a pawn of the president,” said Barbara McQuade, a former U.S. attorney in Detroit who was appointed under President Barack Obama. “Both are intolerable.”

But Shea’s backers say he is a skilled and politically attuned lawyer who got swept up in a political storm.

“He’s very fair, a smart guy, balanced,” said former Massachusetts attorney general Thomas F. Reilly, a Democrat, for whom Shea worked from 1999 to 2001 as chief of the office’s consumer-oriented Public Protection and Advocacy Bureau. “Is he caught in the middle here? Yeah. Things like that can happen your first week on the job.”

Shea and his office were thrust further into the spotlight Friday when the Justice Department revealed it would not charge ­McCabe, a former FBI official accused of lying to investigators about a media disclosure and who authorized the investigation of possible Trump campaign links with Russia. News also emerged that Barr has tasked outside prosecutors to review the handling of Flynn’s case and other sensitive national security and public corruption prosecutions that were handled by the Washington office.

Shea declined to comment for this article and has not spoken publicly about his role in the Stone sentencing controversy that prompted the four front-line prosecutors who handled the case to withdraw from it in protest of the softened recommendation.

Barr’s public explanation of Stone’s sentencing raised more questions, given the timing and circumstances of Shea’s elevation. The attorney general gave just three days’ public notice when he announced that Shea, his counselor, would take over as top prosecutor in Washington on Feb. 3. Shea brought with him as his chief of staff David Metcalf, 34, who had been counsel to Barr’s no. 2, Deputy Attorney General Jeffrey A. Rosen.

Metcalf served as an intermediary between Stone’s prosecutors and Shea, according to those familiar with the conversations.

Current and former lawyers in the office and others familiar with the situation, who spoke on the condition of anonymity to comment freely, said the sudden arrival of Barr’s and Rosen’s top aides raised fears that the department’s political leadership was making a push to exert more control at a key point in sensitive, high-profile prosecutions. Those cases include the prosecution of former Trump national security adviser Flynn and Stone, a confidant of the president’s who is to be sentenced Thursday for lying to Congress and interfering with a witness.

Concerns over political interference are a constant in the U.S. attorney’s office in Washington, whose 300 lawyers have unusual jurisdiction to prosecute local and federal crimes in the nation’s capital, including national security cases and public corruption across the federal government.

Under Trump, the focus on the Washington office was magnified as the office took over cases from former special counsel Robert S. Mueller III’s investigation of Russian interference in the 2016 U.S. election.

Shea took on the role with more than 30 years of experience heading legal and investigative entities at the federal and state level for elected leaders in both parties. He has also worked as a lobbyist and longtime private corporate lawyer.

Shea was born in Fall River, Mass., about 55 miles south of Boston, to a family of five generations of firefighters.

The Fall River Fire Department’s current chief, John D. Lynch, recalled meeting Shea about two decades ago on his father’s retirement, saying in an interview, “He has that Shea look. Tall, broad-shouldered, strapping and strong.”

“Courage and leadership are in their blood,” Lynch said.

Shea graduated from Boston College in 1982 after studying political science and government, and he spent nine years working for the late liberal Republican congressman Silvio O. Conte (R-Mass.) as a personal and professional House Appropriations Committee staffer.

Shea entered Barr’s orbit in 1991. That is when the Georgetown Law School graduate went to work as an associate deputy attorney general for Barr, who was deputy attorney general. Shea remained in the office when President George H.W. Bush elevated Barr to attorney general.

After Bush lost his reelection bid and Barr left the department, Shea remained active in Washington-area legal and political circles, working five years as a federal prosecutor in the Eastern District of Virginia. As a federal prosecutor in Alexandria, the home of the Eastern District office, Shea had appearances in about 120 cases, handling major crimes such as bank robberies and drug offenses, as well as escapes and illegal-weapons charges against inmates at the former prison at Lorton, Va.

Shea left government for stints in private practice and on Capitol Hill before returning to the Justice Department last year as Barr’s counsel.

As U.S. attorney starting Feb. 3, Shea succeeded Trump appointee Jessie K. Liu, who had been in line to become the Treasury Department’s undersecretary for terrorism and financial crimes before Trump abruptly withdrew her nomination on Tuesday around the time the Stone sentencing controversy exploded.

Administration officials said Trump had grown unhappy with Liu after being lobbied extensively by people who did not like her handling of the D.C. office — particularly the cases of individuals including Stone who were charged in the Mueller investigation. Liu has declined to comment on her departure.

Shea takes over an office that is under pressure from District leaders to respond to a decade-high surge in homicides, even as it faces a strained relationship with the District’s Department of Forensic Sciences, the independent city crime lab that handles DNA and firearm testing and is a linchpin for investigating violent crime. In a report filed by Liu, prosecutors said they were concerned about the “integrity and competence” of the crime lab’s management and how the lab’s analyses might be influenced by such factors.

But before taking on such management issues, Shea must weather the political storm involving Stone.

Chuck Rosenberg, a former U.S. attorney and senior FBI and Drug Enforcement Administration official appointed by presidents of both parties, declined to comment about Shea, with whom he worked as a federal prosecutor in Alexandria.

Speaking more generally of department leaders, Rosenberg wrote in a Washington Post opinion article Wednesday about the Stone case, “What political leadership did here — mandating a favor for a friend of the president in line with the president’s publicly expressed desire in the case — significantly damages the rule of law and the perception of Justice Department fairness.”

But those who have worked with Shea say nothing sinister is at play.

“He’s committed to doing the right thing, and the right thing was done here,” said Reilly, the former Massachusetts attorney general.

Ann E. Marimow contributed to this report.