Secretary of State Hillary Rodham Clinton testified on Wednesday before the Senate Foreign Relations Committee on the September 11th attack on the U.S. consulate in Benghazi that killed four Americans. (The Washington Post)

In what probably was her final major public appearance as secretary of state, Hillary Rodham Clinton spent Wednesday delivering a forceful defense of the Obama administration’s response to the killings of four Americans in Libya last year and praising the commitment of the United States’ diplomats.

Clinton, who returned to work this month after suffering a concussion and blood clot in early December, spent six hours testifying and answering questions. She started at 9 a.m. before the Senate Foreign Relations Committee and ended after 5 p.m. with the House Foreign Affairs Committee.

Her long-awaited testimony provided little in the way of new information about the attack in Benghazi. But confronting her critics and delivering a spirited defense of the administration’s response was essential to the effort to put the tragedy behind her as she leaves a job for which she has received wide praise and contemplates a possible presidential run in 2016.

At times, the usually composed Clinton was emotional, choking up as she described meeting the caskets of U.S. Ambassador J. Christopher Stevens and the three other Americans who were killed in the assault on a diplomatic outpost on Sept. 11. Occasionally her patience wore thin. After one Republican pressed her on the administration’s shifting explanations for the attack — which it initially described as the result of a protest — she pounded the table.

“What difference, at this point, does it make?” Clinton demanded. “It is our job to figure out what happened and do everything we can to prevent it from ever happening again.”

She reiterated that she takes responsibility for what an independent investigation called security lapses and systemic failures within the State Department. But she rejected all suggestions by Republicans that there had been a cover-up in the aftermath of the assault on the temporary post and a nearby annex used by the CIA. She also said she never saw requests by Stevens and others for more security.

Controversy over the Benghazi attack has dogged the administration for months. Republicans’ accusations that U.N. Ambassador Susan E. Rice gave a misleading description of the events leading up to the assault resulted in her withdrawing from consideration to replace Clinton, opening the door for the nomination of Sen. John F. Kerry (D-Mass.).

An investigation by an Accountability Review Board appointed by the State Department faulted the department for security shortcomings and not heeding warnings about the dangers in Benghazi and elsewhere in Libya. The board recommended broad changes in security and a review of the way the department spends money and Congress provides it.

Clinton pledged to adopt all 29 recommendations from the review board, saying that many already are being implemented. But she insisted that diplomats must be able to travel and work in dangerous places to do their jobs.

The promises did not satisfy her toughest critics. Rep. Ileana Ros-Lehtinen (R-Fla.) called it “outrageous” that the secretary was not interviewed by the investigators who conducted the independent review.

“I was not asked to speak,” Clinton said, adding that she would have done so if the investigators had thought it important.

For the most part, questions from Democrats were prefaced with praise for Clinton’s tenure as secretary and focused on ways to improve diplomatic security. Republicans were harsher. Rep. Jeff Duncan (R-S.C.) accused Clinton of “national security malpractice” for not better protecting the post where Stevens was killed. “You let the consulate become a death trap,” he said.

Sen. John McCain (R-Ariz.) greeted Clinton politely, but switched his tone quickly, telling her, “Your answers are not satisfactory to me.” He said that “numerous warnings” about militant activity in Libya were not addressed and that the State Department’s desire for a “soft footprint” in the country “was to some degree responsible for what took place.”

Sen. Rand Paul (R-Ky.) said he would have fired Clinton if he had been president, eliciting a gasp from a Clinton aide. And Rep. Dana Rohrabacher (R-Calif.) trying to pin Clinton down later in the day, observed, “Everybody has their own CYA to do here.”

On a lighter note, Rep. Steve Chabot (R-Ohio) drew chuckles when he wished Clinton “the best in your future endeavors — mostly.”

The sessions took place the day before Kerry’s Senate hearing to replace Clinton as secretary. Clinton, who lost the Democratic presidential nomination to Barack Obama in 2008, had always said she would serve only one term in his Cabinet. Kerry, though still chairman of the Senate Foreign Relations Committee, chose not to participate in the hearing to avoid the appearance of a conflict, aides said.

Clinton praised diplomats who are working in peril and on a shoestring, asking Congress to free up existing funding and provide more money for security at high-risk embassies and other diplomatic posts worldwide.

As ambassador to Libya, Stevens had sent repeated cables to Washington seeking better security, a point several Republicans raised during the two sessions. In the morning hearing before the Senate, Clinton said that she never saw the requests. “They did not come to me,” she said. “I did not approve them. I did not deny them.”

Even under sometimes tough questioning, Clinton visibly lost her temper only during the exchange with Sen. Ronald H. Johnson (R-Wis.) when he accused Rice of “purposely misleading the American public” about events leading up to the Benghazi attack. Five days after the assault, Rice said in television interviews that it grew out a spontaneous protest, not a planned terrorist operation. The administration later reversed that view.

Slamming the table and staring at Johnson, Clinton said: “Nothing could be further from the truth. The fact is that people were trying in real time to get to the best information.”

Clinton cast the attack that killed Stevens, diplomat Sean Smith and CIA contractors Tyrone Woods and Glen Doherty as part of a larger rise of militancy across a vast swath of northern Africa and the Middle East. Linking the attacks loosely to the instability now on display in Mali and Algeria, Clinton said understanding and confronting that challenge transcends politics.

“We are in a new reality. We are trying to make sense of changes that nobody had predicted but which we’re going to have to live with,” she said. “Let’s be honest with ourselves. Let’s avoid turning everything into a political football.”

Clinton’s voice broke as she described receiving the caskets of the Americans at Joint Base Andrews a few days after the attack.

“For me, this is not just a matter of policy. It’s personal,” she said, choking up. “I stood next to President Obama as the Marines carried those flag-draped caskets off the plane at Andrews. I put my arms around the mothers and fathers, the sisters and brothers, the sons and daughters, and the wives left alone to raise their children.”