By Jonathan Allen and John Whitesides

WASHINGTON (Reuters) - Former Secretary of State Hillary Clinton on Thursday deflected harsh Republican criticism of her handling of the deadly 2012 attack in Benghazi, Libya, and urged her questioners in Congress to put U.S. national security ahead of politics.

At a sometimes bitter day-long hearing, Republicans accused the front-runner in the 2016 Democratic presidential race of misinforming the public about the cause of the attack by suspected Islamic militants that killed the U.S. ambassador and three other Americans in Benghazi.

Clinton, 67, calmly avoided the fray during the most heated exchanges between Republicans and her Democratic allies, and stayed composed under sometimes hostile and aggressive questions from Republican lawmakers.

But hours of questioning uncovered no new revelations in a deadly incident that has been the subject of a half-dozen other congressional investigations and an independent inquiry.

In one of the most pointed exchanges, Republican Representative Jim Jordan said Clinton had misleadingly implied after the attack that it was a reaction to an anti-Muslim video. Clinton, who denies suggesting the video was the cause, called Jordan's accusation "personally painful."

"I've thought more about what happened than all of you put together," she told the Republican-led panel. "I've lost more sleep than all of you put together. I've been racking my brain about what could have been done, should have been done."

The appearance before the Benghazi panel was a political test for Clinton, who has been on a hot streak with a strong performance in last week's first Democratic debate and the news on Wednesday that her strongest potential challenger, Vice President Joe Biden, will not seek the Democratic nomination for the November 2016 election.

The hearing also follows weeks of political brawling over whether the House committee's real goal was to puncture her front-running presidential prospects. The committee is made up of seven Republicans and five Democrats.

Story continues

Clinton told the panel the attacks must not discourage U.S. action globally and said the incident already had been thoroughly investigated.

"We need leadership at home to match our leadership abroad, leadership that puts national security ahead of politics and ideology," Clinton said in her only early reference to the political controversy that has dogged the panel.

Opinion polls show Americans deeply split along partisan lines over the probe. A Reuters/Ipsos poll this week found 35 percent of respondents viewed the Benghazi hearings as mostly or completely valid. The percentage among Republicans was 67 percent, independents 39.6 percent, and Democrats 16.5 percent.

17-MONTH-OLD PROBE

The panel has spent 17 months looking into the attacks that killed J. Christopher Stevens, the U.S. ambassador to Libya, and three other Americans at the U.S. mission compound.

At one point, Clinton impassively stacked papers while Republican Chairman Trey Gowdy and senior Democrat Elijah Cummings argued loudly over Cummings' request that the closed-door testimony of Clinton friend Sidney Blumenthal be publicly released.

Clinton listened intently, head in hand, as Gowdy heatedly questioned her about the constant emails she received from Blumenthal. Republicans noted that ambassador Stevens did not even have Clinton's email address.

"You didn't need my email address to get my attention," Clinton said.

Cummings said congressional Republicans set up the panel for a partisan witch hunt.

"They set them loose, Madame Secretary, because you're running for president," he told Clinton, calling for an end to the "taxpayer-funded fishing expedition." He said the committee had spent $14.7 million of taxpayer money over 17 months.

Clinton defended her leadership in Libya as America's top diplomat and denied longstanding Republican allegations that she personally turned down requests to beef up security in Benghazi.

"He did not raise security with me. He raised security with the security professionals," Clinton said of Stevens.

Republican Representative Peter Roskam told Clinton she was the chief architect of U.S. policy in Libya and that "things in Libya today are a disaster," but Clinton said President Barack Obama made the final call on U.S. Libya policy.

Clinton's long-awaited appearance before the panel follows months of controversy about her use of a private home email server for her State Department work, a set-up that emerged in part because of the Benghazi committee's demand last year to see her official records.

GOWDY ON THE DEFENSIVE

Gowdy, a former federal prosecutor, has been on the defensive over a series of comments from his fellow Republicans implying the committee's real aim was to deflate Clinton's poll numbers.

"Madame Secretary, I understand some people - frankly in both parties - have suggested this investigation is about you. Let me assure you it is not," Gowdy told Clinton.

"Not a single member of this committee signed up for an investigation into you or your email system."

Clinton refrained from questioning the panel's motives, which she has done in recent public statements on the campaign trail.

"Despite all the previous investigations and all the talk about partisan agendas, I’m here to honor those we lost and to do what I can to aid those who serve us still," she said.

She said the emails being made public and examined by the committee did not encompass all of the work she did as secretary of state.

"I don’t want you to have a mistaken impression about what I did and how I did it," she said. "Most of my work was not done on emails with my closest aides, with officials in the State Department, officials in the rest of the government."

She cited communications through secure phone calls, in-person conversations and top-secret documents.

The committee's Democrats, who may discuss abandoning the inquiry after Clinton's appearance, say they think there is little left to unearth on Benghazi.

A 2012 report by a government accountability review board sharply faulted State Department officials for providing "grossly" insufficient security in Benghazi, despite upgrade requests from Stevens and others in Libya.

(Additional reporting by Ginger Gibson, Alana Wise and Megan Cassella; Editing by Howard Goller)