Democrats and Republicans in the Senate agreed on Tuesday to draft a housing rescue bill that could deliver billions of dollars to homeowners facing foreclosure and help steer the economy away from a deep recession.

Democratic leaders want the federal government to pay for more mortgage counselors, rehab projects for empty homes and tax breaks for borrowers stuck in unaffordable loans. Perhaps the most controversial provision of their plan would let bankruptcy judges erase some mortgage debt.

Lawmakers and policy-makers on all sides agree that the country is facing a tough economic crisis led by a wave of failing home loans, but Republicans generally resist a big government bailout.

Earlier this year, Democratic lawmakers failed to muster enough votes to carry their agenda unilaterally and so decided to work with Republicans.

Setting a deadline of noon on Wednesday to reach a bipartisan deal, the senators said they would try to overcome deep disagreements over the scope of the legislation.

"Bipartisan senators are committed to moving forward with legislation," Senate Majority Leader Harry Reid, a Nevada Democrat, told reporters.

Senate Minority Leader Mitch McConnell, a Republican from Kentucky, said senior members of the Senate Banking Committee would work together over the next 24 hours to merge proposals from both parties.

The compromise language will chiefly be written by Sen. Christopher Dodd and Sen. Richard Shelby who are, respectively, the top Democrat and Republican on the Senate Banking Committee.

Democrats have called for $200 million in new funds for pre-foreclosure counselors and $4 billion in grants to local communities who must now help caretake empty homes. A mortgage bond program would be expanded and home buyers would have new consumer protections if Democratic language makes its way into the final bill.

Like most mortgage lenders, Republicans generally oppose the Democrats' proposed bankruptcy changes, and several industry and consumer sources said that they expect a tough fight over that provision.

Illinois Democratic Sen. Richard Durbin said: "The bankruptcy provision is critical ... We have really tried to keep this as limited as possible."

Durbin told reporters he did not know how Dodd and Shelby will handle the provision, adding: "I've been given an assurance that there will be a vote on the bankruptcy provision."

Republicans have offered several proposals on the housing crisis, including giving a $15,000 tax credit over three years to purchasers of homes in or near foreclosure.

Shelby noted there is a "crisis of confidence" in housing and financial markets and said the banking committee probably will work all night on getting the bill together.

Dodd said the Bush administration seems to be coming around to supporting some of the housing measures in Congress. "They have warmed up. I'm hopeful we can do something here that will attract their support," Dodd told reporters.

The House of Representatives in mid-November adopted a bill aimed at preventing some of the lending abuses that helped inflate the recent home price bubble that is now deflating.

The White House last month voiced support for some of the proposals in the House bill. The administration has also asked for voluntary support from banks to help distressed mortgage borrowers work out their debts.

Dodd and Massachusetts Democratic Rep. Barney Frank have both proposed permitting the Federal Housing Administration to offer $300 billion more in new guarantees to help refinance distressed mortgages that banks and mortgage holders have agreed to write down significantly. That sweeping plan is likely to be pushed off until after the senate resolves the latest housing-aid package.

The announcement of the agreement to seek a compromise came just prior to the Senate voting 94-1 in a procedural test to allow debate on a housing bill written by Democrats.

Kentucky Republican Sen. Jim Bunning was the only senator to oppose the procedural test, which needed 60 votes to pass. The overwhelming win on the test vote underscored the strength of the agreement to work for a compromise.