WASHINGTON — Attorney General William P. Barr was at home in his study, working on a speech, when the call came from his chief of staff: Jeffrey Epstein, the financier accused of sex trafficking who had connections to an array of political power players, had died in federal prison.

Mr. Barr immediately knew that he would be engulfed in a scandal. The prison had promised to keep Mr. Epstein under constant surveillance until he could be tried on charges of sexually abusing dozens of underage girls. With his accusers now robbed of their day in court, the Justice Department, which oversees the Bureau of Prisons, looked incompetent at best. And as Mr. Barr scrambled for answers, unfounded conspiracy theories took root, casting an additional pall over the matter and threatening the public’s faith in the department.

Over multiple briefings an hour, Mr. Barr spent that Saturday angrily grilling his deputies. He directed the F.B.I. to investigate Mr. Epstein’s apparent suicide and the department’s inspector general to look for lapses in protocol. After the Bureau of Prisons confirmed the death and the F.B.I. inquiry that morning, Mr. Barr issued a statement, surprising officials who believed the bureau would have the last word. “Mr. Epstein’s death,” he said, “raises serious questions that must be answered.”

Attorneys general rarely follow up on inmate deaths, but Mr. Barr has continued to bird dog the investigation into how one as high-profile as Mr. Epstein could have died in federal care, evidence of how serious the matter is for the Justice Department. This account of his search for answers is based on interviews with six people involved in the investigation into Mr. Epstein’s death, most of whom spoke on the condition of anonymity to describe internal department discussions.