Treasury Secretary Janet Yellen on Wednesday defended Democrats’ efforts to pass a roughly $2 trillion social-spending package, amid Republicans’ criticisms that fiscal policy implemented earlier this year overstimulated the economy and fueled higher inflation.

“We had a very sizable fiscal stimulus,” Ms. Yellen told the House Financial Services Committee. “We addressed what was a very substantial risk” of a prolonged economic downturn, she said.

Ms....

Treasury Secretary Janet Yellen on Wednesday defended Democrats’ efforts to pass a roughly $2 trillion social-spending package, amid Republicans’ criticisms that fiscal policy implemented earlier this year overstimulated the economy and fueled higher inflation.

“We had a very sizable fiscal stimulus,” Ms. Yellen told the House Financial Services Committee. “We addressed what was a very substantial risk” of a prolonged economic downturn, she said.

Ms. Yellen disputed concerns raised by Rep. Patrick McHenry (R., N.C.), the committee’s top Republican, and other Republicans that the Biden administration had spent too much money when Congress and the White House approved a $1.9 trillion relief spending measure in March. Ms. Yellen said the package, which was approved in Congress without GOP support, had provided crucial support to families struggling to stay afloat during the pandemic.

“Inflation is a matter of demand and supply, and it’s certainly true that the American Rescue Plan put money into people’s pockets,” Ms. Yellen said. “But if you look at the amount of inflation that we have and its causes, that is at most a small contributor.”

Her defense of the March aid package came as Democrats are aiming to give final Congressional approval for President Biden’s spending proposal for climate change, child care and other social programs. Republicans have been pointing to the March package to argue that additional spending would worsen inflation.

“You went forward with the American Rescue plan, which we warned would increase inflation,” said Rep. Anthony Gonzalez (R., Ohio). “You’re set to repeat the exact same mistake with Build Back Better,” he added, referring to the social-spending plan.

Inflation has surged this year—to 5% in October from a year earlier, according to the Federal Reserve’s preferred gauge—amid strong demand for goods and services that have faced supply-chain bottlenecks associated with reopening the economy from the Covid-19 pandemic.

Ms. Yellen said inflation was being driven more heavily by a shift in the composition of spending to goods and away from services than it was by increased government outlays.

The Biden administration has been working to show that its policies will help address supply chain issues and elevated inflation. Ms. Yellen during Wednesday’s testimony said the social-spending package wouldn’t add to the national deficit or debt and would help to promote labor-force participation and ease financial constraints for American families.

The nonpartisan Congressional Budget Office found that the package would add $367 billion to the deficit over 10 years, but Ms. Yellen and other Democrats have noted that estimate doesn’t include expected revenue from measures in the bill providing for stricter tax enforcement at the Internal Revenue Service. The White House and Treasury Department have estimated those enforcement activities would generate roughly $480 billion in revenue over 10 years, while the CBO estimates that figure would be $207 billion.

Higher inflation has put pressure on the Fed to raise interest rates earlier next year than officials had anticipated just a few months ago. Ms. Yellen testified alongside Fed Chairman Jerome Powell, who said that inflation risks had grown recently.

“The risks of higher inflation have moved up,” he said on Wednesday. While many of the inflationary pressures this year are still tied to factors associated with reopening the economy from the pandemic, inflation “has spread more broadly in the economy,” Mr. Powell said.

Mr. Powell said in a Senate hearing on Tuesday that the Fed was preparing to wind down its easy-money policies more quickly, opening the door to raising interest rates in the first half of next year. The comments sent stock markets tumbling and government bond yields up.

“We will use our tools to make sure that this high inflation we’re experiencing is not entrenched,” Mr. Powell said on Wednesday.

The Fed is grappling with how to chart policy amid an inflationary surge that has been larger and is proving to last longer than most private-sector economists expected. The emergence of the Omicron coronavirus variant adds a new degree of unpredictability by threatening to exacerbate supply-chain bottlenecks.

Federal Reserve Chairman Jerome Powell discussed in a Senate hearing the factors driving continued inflation and the risk the Omicron variant poses for the economy. Photo: Al Drago/Bloomberg News The Wall Street Journal Interactive Edition

Write to Nick Timiraos at nick.timiraos@wsj.com and Amara Omeokwe at amara.omeokwe@wsj.com