WASHINGTON — Moving with lightning speed, the Democratic-controlled Congress and White House agreed Wednesday on a compromise $790 billion economic stimulus bill designed to create millions of jobs in a nation reeling from recession. President Barack Obama could sign the measure within days.

"More than one-third of this bill is dedicated to providing tax relief for middle-class families, cutting taxes for 95 percent of American workers," Senate Majority Leader Harry Reid said at a Capitol news conference where he was joined by moderates from both parties whose support is essential for the legislation's final passage.

House Speaker Nancy Pelosi, D-Calif., Reid's partner in negotiations over more than 24 hours, initially withheld her approval for more than two hours in a dispute over federal funding for school construction. She said the delay had been worth it: "We had to make sure the investment in education" was in the bill.

Obama, who campaigned energetically for the measure, welcomed the agreement in a written statement that said it would "save or create more than 3.5 million jobs and get our economy back on track."

The emerging legislation is at the core of Obama's economic recovery program, and includes help for victims of the recession in the form of expanded unemployment benefits, food stamps, health coverage and more, as well as billions for states that face the prospect of making deep cuts in school aid and other programs.

Another provision will mean a one-time payment of $250 for millions of beneficiaries who receive Social Security, Supplemental Security Income and veterans pensions and disability, according to officials.

The measure also preserves Obama's signature tax cut — a break for millions of lower- and middle-income taxpayers. Wage-earners who don't make enough to pay income taxes would get a reduction in the Social Security and Medicare taxes they pay.

Working to accommodate the new, lower overall limit of the bill, negotiators effectively wiped out a Senate-passed provision for a new $15,000 tax credit to defray the cost of buying a home, officials said. The agreement would allow taxpayers to deduct the sales tax paid on new car purchases, but not the interest on loans for the same vehicles.

The bill "will be the beginning of the turnaround for the American economy," predicted Sen. Joseph Lieberman, an independent from Connecticut who votes with Democrats.

Republicans couldn't have disagreed more.

"It appears that Democrats have made a bad bill worse by reducing the tax relief for working families in order to pay for more wasteful government spending," said Rep. John Boehner of Ohio.

The events capped a frenzied 24-plus hours that began at midday Tuesday when the Senate approved its original version of the bill. Reid, Pelosi and White House Chief of Staff Rahm Emanuel plunged into a series of meetings designed to produce agreement in time for Obama to sign the bill by mid-month.

South Carolina Gov. Mark Sanford has been a vocal opponent of the stimulus bill, suggesting the state might refuse some of the more than $3 billion in the plan for South Carolina.

Joel Sawyer, press secretary for the governor, said earlier this week that Sanford's opposition is aimed at protecting the state's economic health.

"Every penny of this stimulus is money we don't have, and every penny spent on these ill-conceived plans moves us that much closer to a prolonged and deepened recession, if not a depression," he said.