By Nicholas Fandos and Katie Benner, New York Times–

The Senate confirmed William P. Barr on Thursday for a second stint as attorney general, handing oversight of the Justice Department — and its ongoing investigation into links between Russia’s interference in the 2016 election and the Trump campaign — to a seasoned Republican legal hand known for his expansive view of presidential power.

Senators expressed hope that the installation of a conventional figure like Mr. Barr could return some stability to the Justice Department’s 115,000 employees, after two years of intense battering by President Trump and his allies in Congress. The president lost confidence in his first attorney general, Jeff Sessions, early on and, after months of publicly scorning him for recusing himself from overseeing the Russia investigation, Mr. Trump installed Mr. Sessions’s chief of staff, Matthew G. Whitaker, as a temporary replacement in November.

“Steady leadership at a time we need steady leadership to give a morale boost to the Department of Justice,” Senator Lindsey Graham, Republican of South Carolina and the Judiciary Committee chairman, said shortly before the vote. “Somebody who will be fair to the president, but also be fair to the rule of law and protect the integrity of the Department of Justice.”

But with the special counsel, Robert S. Mueller III, believed to be finishing his work, Mr. Barr’s tenure is likely to be shaped by the same cross currents, and his decisions could have far-reaching consequences for Mr. Trump, the presidency and the department for years to come.

In the latest example of the extraordinary strains the Trump presidency has put on the department, a former deputy F.B.I. director, Andrew G. McCabe, said in an interview with CBS broadcast on Thursday that top Justice Department officials had been so alarmed by Mr. Trump’s decision to dismiss James B. Comey, the bureau’s director, in May 2017 that they discussed whether to recruit cabinet members to invoke the 25th Amendment to remove the president from office.

Mr. Barr assured senators during the confirmation process that he would not allow political interference to sway the department’s work, but under pressure from Democrats, he would make no specific assurances to make Mr. Mueller’s findings public, foreshadowing a potentially caustic fight.

Divided over whether to accept his assurances, the Senate voted largely along party lines, 54 to 45, to confirm Mr. Barr. Mr. Trump is expected to swear him in at the Oval Office later Thursday.

A handful of senators separated from their parties on the Senate floor. One libertarian-leaning Republican, Senator Rand Paul of Kentucky, voted against Mr. Barr, citing concerns over his sweeping view of executive power. Three Democrats from conservative or swing states — Senators Doug Jones of Alabama, Kyrsten Sinema of Arizona, and Joe Manchin III of West Virginia — supported him.

Mr. Barr previously served as attorney general from 1991 to 1993, under President George Bush, before spending the last quarter-century as a corporate lawyer — much of it with the telecommunications company that became Verizon.

Even before the vote, Mr. Barr was planning steps to begin putting his imprint on the department. He intends to call on Jeffrey A. Rosen, the current deputy secretary of transportation, to serve as deputy attorney general, two people briefed on the choice said. His nomination would be subject to a Senate vote. Rod J. Rosenstein, the current deputy attorney general who appointed Mr. Mueller and oversaw his work until late last year, plans to remain at the department for a transition period expected to last only a few weeks.

Like Mr. Barr, Mr. Rosen was a longtime lawyer at the law firm Kirkland & Ellis, where he was a member of its global management team. He held senior positions at the Office of Management and Budget and the Department of Transportation during President George W. Bush’s administration.

The fight over Mr. Barr’s nomination in the Senate centered on how he would handle the special counsel investigation, as well as other inquiries by federal prosecutors in New York looking at Mr. Trump’s campaign and inaugural committee.

Democrats seized on a lengthy legal memo that Mr. Barr wrote in June 2018 for the Trump administration and shared with Mr. Trump’s outside legal team. It argued that the president wielded unchecked power to “start or stop a law enforcement proceeding,” and therefore Mr. Mueller should not be allowed to investigate whether Mr. Trump committed obstruction of justice by pressuring Mr. Comey to drop an investigation into a top aide.

In a confirmation hearing last month and private conversations before the vote, Democrats demanded that Mr. Barr pledge to make public any final report by Mr. Mueller describing the findings of his investigation. But Mr. Barr resisted making any specific commitments, saying the he did not know what Mr. Mueller would produce or whether it could include information that must remain secret, such as grand-jury testimony. He pledged instead that he would be as transparent as possible.

In doing so, Mr. Barr promised to obey Justice Department regulations for special counsel investigations, created by the Clinton administration in 1999 after the independent counsel at the time, Ken Starr, produced a lengthy and salacious report about President Bill Clinton’s affair with Monica Lewinsky.

Those rules do not envision a lengthy report going directly from the investigator to Congress and the public. Rather, they envision a report to the attorney general, who then sends a separate notification to Congress explaining that the investigation has ended.

Republicans said those assurances were sufficient. But Democrats were not satisfied.

“Everything that is my concern is in the memo, the 19-page memo he wrote five months before he was appointed,” said Senator Dianne Feinstein of California, the top Democrat on the Judiciary Committee. “To me, it was an invitation to be appointed with his support for the unitary executive and the all-powerful president.”

Get politics and Washington news updates via FacebookTwitter and the Morning Briefing newsletter.