WASHINGTON — A massive foreclosure rescue bill cleared a key Senate test Tuesday by an overwhelming margin, with Democrats and Republicans both eager to claim election-year credit for helping hard-pressed homeowners.

The mortgage aid plan would let the Federal Housing Administration back $300 billion in new, cheaper home loans for an estimated 400,000 distressed borrowers who otherwise would be considered too financially risky to qualify for government-insured, fixed-rate loans.

An 83-9 vote put the plan on track for Senate passage as early as today, but President Bush is threatening a veto, and Democrats are fighting each other over key details. Those challenges will probably delay any final deal until mid-July.

At the Capitol, Sen. Christopher J. Dodd, D-Conn., the Banking Committee chairman, said the lending measure "would allow us to begin to put a tourniquet on the hemorrhaging of foreclosures in this country."