Senate Intelligence Chair Dianne Feinstein (D-Calif.) accused the CIA of breaking the law by searching her committee's computers. The Post's Karen Tumulty, Scott Wilson, Terence Samuel and Adam Goldman explain the impact in Washington. (Julie Percha and Theresa Poulson/The Washington Post)

For years, a small group of Senate staffers made regular commutes to a Virginia office used by the CIA, took the elevators down to the basement and tapped the keypad combination to an unmarked door.

Inside, a collection of eight or so computers were loaded with millions of CIA cables, memos and other records that documented what many regard as one of the darker chapters of the agency’s history — its use of harsh interrogation measures to get terrorism suspects to talk.

The bulk of the research was completed more than a year ago, yielding a report by the Senate Intelligence Committee that amounts to a damning chronicle of that CIA program. But the struggle to shape whether and how that history is presented to the public has triggered a fight between the CIA and the committee over what happened behind that locked door.

The dispute, which spilled into public view this week, centers on whether the committee broke laws in obtaining a set of documents the agency never intended to share, or whether the CIA broke laws in its searches of committee computers to see how those files ended up in the panel’s possession.

The documents themselves would seem to be of little significance. Created at the direction of then-CIA Director Leon E. Panetta, they were meant to take inventory of the records being turned over to Congress and, in some cases, anticipate in written asides how damaging some of that material might be in the committee’s hands.

Nevertheless, control of those “Panetta review” documents could be critical to whether that report comes to be seen as an exhaustive and accurate accounting of the CIA’s interrogation operations or, as many agency officials contend, a flawed document that reaches deeply misguided judgments about the program and whether it worked.

In her speech Tuesday on the Senate floor, Sen. Dianne Feinstein (D-Calif.), the chairman of the Intelligence Committee, acknowledged that the review documents are not even cited in the committee’s final report. But she made clear that the Panetta review could be a powerful shield for the committee against any CIA effort to criticize or discredit its final report.

Last year, CIA Director John Brennan hand-delivered a lengthy CIA rebuttal to the committee’s report, raising objections to many of its findings and cataloguing dozens of alleged errors. Feinstein said that feedback is at odds with the Panetta review, which “corroborates critical information in the committee’s 6,300-page study that the CIA’s official response either objects to, denies, minimizes or ignores.”

“These Panetta review documents were in agreement with the committee’s findings,” Feinstein said. “That’s what makes them so significant and important to protect.”

It may also explain why the CIA initially sought to get the documents back. When that failed, the agency took the extraordinary step of referring the matter to the Justice Department for a possible criminal probe into how the committee gained access to the Panetta documents on the computer system set up by the CIA, then secretly made off with a printed copy that now resides in a safe in the Hart Senate Office Building on Capitol Hill.

In a speech delivered just hours after Feinstein’s appearance on the Senate floor, Brennan urged “members of the Senate to take their time, to make sure that they don’t overstate what they claim.”

“Appropriate authorities right now, both inside of CIA as well as outside of CIA, are looking at what CIA officers as well as [Intelligence Committee] staff members did,” Brennan said. He also outlined the broader stakes, saying he and others “owe it to the women and men who basically did their duty in executing this [interrogation] program to try to make sure that any historical record is a balanced and accurate one.”

The rupture has revealed aspects of the agency’s relationship with one of its main external watchdogs that rarely surface in public view. Feinstein’s decision to launch a public attack on the CIA also exposed new details about the course of a politically charged investigation that has been shrouded in secrecy for nearly five years.

The probe was launched in 2009, nearly three years after the CIA’s network of secret overseas prisons had been emptied, with the detainees seen as most valuable — and subjected to some of the harshest interrogation measures — transferred to Guantanamo Bay, Cuba.

The investigation grew out of a smaller, earlier arrangement in which the CIA agreed to give committee aides access to some of the records of the interrogation program, partly to placate members outraged by the revelation that CIA officers had destroyed videotapes of some of those early sessions.

Staff members who reviewed those files discovered that “the interrogations and the conditions of confinement at the CIA detention sites were far different and far more harsh than the way the CIA had described them to us,” Feinstein said.

At the time, President Obama was newly sworn in and had made dismantling the program one of his first acts in office. His characterization of the program as torture had angered many in the George W. Bush administration and CIA veterans, sparking an intense public debate.

Feinstein, who had recently become chairman of the committee, envisioned the investigation as a way to answer one of the most contentious questions: whether harsh interrogation measures, including the simulated-drowning technique known as waterboarding, worked.

In March 2009, the committee voted 14 to 1 to open its formal probe. Only Sen. Saxby Chambliss (Ga.), who later became the ranking Republican on the panel, voted against it.

The committee wanted the CIA to turn over all of its documents relating to the program. But Panetta, newly installed as agency chief, proposed an alternative: putting the files on computers at a secret CIA facility miles from agency headquarters, where committee investigators could scour the documents.

The digital pile was unwieldy, with no index or structure. Investigators organized their searches around names of CIA prisoners, scanning for any references to Khalid Sheik Mohammed and others who had been held at the secret CIA sites.

Bipartisan backing for the probe unraveled when it became clear that CIA operatives, who also faced a Justice Department criminal inquiry, were not going to cooperate.

“I thought the investigation would be totally lacking” without the ability to interview CIA employees involved in the program, said former senator Christopher “Kit” Bond (Mo.), who was the ranking Republican. He and other GOP members backed out.

Republicans also voiced concern that the report would be shaped by political interests.

The partisan split extended through the staff ranks. Republican aides who had been reviewing documents alongside their Democratic counterparts were soon kept out of the document facility by a newly installed security keypad on the door, officials said. They were later given access in a separate room so they could keep reviewing the raw files and possibly submit dissenting views on the final report.

Suspicion between the CIA and the Democratic staff also grew. Feinstein said investigators noticed that hundreds of documents had been removed from the database in 2010 with no explanation, possibly reeled back by agency officials worried that they could expose the names of sources and methods too sensitive to be disclosed.

The White House was called in to settle the dispute. But Feinstein cited that episode as one reason the committee later took printed copies of the Panetta review without notifying the agency, in apparent violation of the two sides’ arranged rules.

Precisely how the committee obtained that document remains unclear. Feinstein said it was found on the shared database using a search tool provided by the agency. “The committee staff did not hack into CIA computers to obtain these documents,” she said.

The CIA has declined to comment on the matter, but Brennan has struck a pose of confidence that an FBI investigation will uncover evidence that the committee’s actions were not as benign as Feinstein claimed.

U.S. officials said the network set up under Panetta included three distinct areas, each sealed off by a firewall — one accessible only to the committee, one exclusively for the CIA, and a shared space in the center where the agency could put records it wanted to share.

“The firewall was breached,” said a U.S. official briefed on the matter. “They figured out a work-around.”

If true, that would represent an embarrassing lapse in security in the computer system assembled by the agency. But, to agency officials, such a breach and a concern about getting caught would explain why the committee last year began asking for documents it already had.

Committee officials flatly deny that the files were obtained through surreptitious means.

The dispute has exposed a thicket of potential conflicts. Among them is the fact that the CIA’s acting general counsel, who Feinstein said is named in the report more than 1,600 times, made the criminal referral about committee staff to the Justice Department.

The fallout has also focused attention on Feinstein and Brennan, revealing a deep rupture between two of the most powerful figures in the U.S. intelligence community that has the potential to spill into other areas where spy agencies rely on Feinstein as an ally.

Feinstein has been among the most ardent backers of the CIA’s drone campaign, for example, citing a deep confidence in the information that she and her staff have gleaned from frequent and detailed briefings provided by the same agency she has now accused of a pattern of misconduct and deception.

Brennan is widely respected for his integrity and deep experience in intelligence work. But some congressional officials this week questioned whether his indignation at the committee’s charges — and a tendency to dig in his heels when challenged — had worsened the conflict.

“How this will be resolved will show whether the intelligence committee can be effective in monitoring and investigating our nation’s intelligence activities,” Feinstein said, “or whether our work can be thwarted by those we oversee.”

Julie Tate contributed to this report.