In her first public words since becoming Fed chair this month, Yellen struck a note of unity with her predecessor, Ben Bernanke, who stepped down last month. She embraced his dual outlook on the economy: It’s strengthening enough for the Fed to slightly pull back its stimulus yet still needs the help of low interest rates.

When her questioners turned aggressive, Yellen stoutly defended the Fed’s approach to the 2008 financial crisis and the recession. She rebuffed suggestions that its stimulus efforts were ill-conceived or that stricter financial rules were squelching growth.

At times, she basked in good wishes from members of the House Financial Services Committee, to which she was delivering the Fed’s twice-a-year report to Congress. Several female members offered warm congratulations to the first woman to lead the Fed in its 100 years.

“I’ve understood more of what you’ve said today than the last two (Fed leaders),” said Rep. Shelley Moore Capito, R-W.Va.

Fed leaders can make unusual witnesses at Washington hearings. Unlike many government officials, they strive to protect their political independence by avoiding confrontation. Yellen kept her guard up yet aimed not to sound combative.

She dropped no hints of how her leadership might depart from Bernanke’s. She stressed that the Fed would decide whether to continue paring its bond purchases — and eventually to raise short-term rates — based on how the economy improved. The Fed’s bond purchases are intended to keep borrowing rates low to stimulate growth.

At times, her descriptions of Fed policy and strategy mirrored Bernanke’s nearly to the word. Her key goal: Assure investors that the Bernanke-Yellen transition would be seamless.

It appeared to work. Yellen’s testimony contributed to a powerful rally on Wall Street. The Dow Jones industrial average soared nearly 200 points.

“She clearly has read the Fed playbook on how to not say a lot,” said Brian Gardner, head of Washington research for Keefe, Bruyette & Woods, an investment bank.

Yellen, 67, offered “unsolicited” to “stay all day,” noted the committee chairman, Jeb Hensarling, R-Texas. That was a break from recent practice. Bernanke and his predecessor, Alan Greenspan, tended to sit for questions for only two or three hours.

Stay she did. Yellen testified for nearly five hours, beginning soon after 10 a.m. and enduring well into midafternoon, minus a lunch break and two brief pauses.

Yellen repeated the Fed’s expectation that it will keep its key short-term rate near zero “well past” the time the unemployment rate falls below 6.5 percent, as long as inflation remains low.

That assurance provoked a tart response from Republicans: Before the Fed changed its likely timetable last year, it had said that short-term rates could rise once unemployment reached a 6.5 percent threshold. Now, most economists don’t expect short-term rates to be raised until 2015, even though the unemployment rate is 6.6 percent, the lowest in more than five years.

Hensarling wondered: When it comes to interest-rate policy, is the Fed “improvising”?

The Texas congressman pointed out that Yellen herself had once said that “sensible” central bankers followed rules.

“Using your words,” Hensarling said, “are you a sensible central banker, and if not, when will you become one?”

“I believe that I am a sensible central banker, and these are very unusual times,” she replied.

Several Democrats asked Yellen how the Fed might narrow the rising gap between the richest Americans and everyone else. Yellen struck a note of regret. She suggested that the growing concentration of wealth might help explain why the recovery has been so sluggish. Yet she said the Fed had few options for stopping “one of the most disturbing trends facing the nation.”

When pressed on whether the Fed’s low-rate policies had allowed government spending to get out of control, Yellen struck back. Higher rates would cause the economy to slow, if not sink into recession and possibly require more deficit spending to aid a recovery, she said.

Yellen’s nerves occasionally showed during the hours of testimony. She struggled to define what constituted a full-time job. (“Thirty-five hours,” an aide told Yellen.) And while she spoke with authority on interest-rate policy, her discussion of bank regulation sometimes sounded indecisive.

A group of conservative Republicans pushed Yellen to explain why she opposed legislation that would subject the Fed to audits by the Government Accountability Office on its rate decisions. Yellen noted that the Fed is already subject to GAO audits in some areas. But she said that allowing the GAO to second-guess interest-rate actions would expose the Fed to improper political influence.

Rep. Michele Bachmann, R-Minn., argued that the Fed was wrong to oppose the audit legislation. “The American people are feeling less and less empowered to hold the Fed responsible,” Bachmann said.

Yellen responded that “hearings like this” gave Congress the chance to hold the Fed accountable.

At the other end of the political spectrum, Rep. David Scott, D-Ga., urged her to be bolder in addressing long-term unemployment. He said many older workers who had been laid off and young people trying to enter the workforce were growing increasingly discouraged. He said the Fed should do more to prioritize job growth.

Rep. Ed Perlmutter, D-Colo., described Bernanke as “very smart, very steady and not very exciting.”

“I have to say, you’re following in his footsteps,” he said.

By the end, by all accounts, she had made no serious gaffes.

“She avoided all the major pitfalls that were presented to her,” said Jason Rosenstock, a lobbyist at Thorn Run Partners who works on financial services issues. “If the goal of the chair is to do no harm in these hearings, then she succeeded.”