The Republican-controlled Congress voted yesterday for a temporary spending measure that would keep the government open for another three weeks as it tries to resolve internal differences over defense and education spending and other issues in next year's budget.

But lawmakers remained locked on a confrontational course with President Clinton, who has indicated he would veto five or more spending bills because of concern over GOP spending and policy priorities. Just yesterday, the president vetoed the D.C. appropriations bill because of restrictions on local officials added by congressional Republicans.

As they struggle to put together a spending plan for next year, the White House and GOP lawmakers are far apart on numerous issues. Perhaps the biggest differences involve Republican efforts to attack the president's signature education and social policy initiatives, such as hiring 100,000 new teachers and the AmeriCorps public service program.

Numerous other presidential irritants litter the spending bills under consideration in Congress: The GOP has axed Clinton's request for funding for the Wye River peace accords, cut funds for low-income housing, inserted numerous provisions that presidential aides say would weaken environmental protections and revived a plan to delay the benefits of an earned income tax credit for the working poor.

Negotiating over such issues may prove especially troublesome this year because of GOP determination to avoid a massive year-end spending bill. Convinced that they gave away the store to Clinton during budget talks last year, congressional leaders stressed yesterday they would take a piecemeal approach this time, responding to specific concerns of the administration without seeking any comprehensive budget deal.

"Last year was a horrendous mistake of sitting down the president in a summit situation," House Majority Whip Tom DeLay (R-Tex.) said during an appearance at the conservative Heritage Foundation. "He's trying to push us there right now. We're not going."

But House and Senate Democratic leaders said the Republicans are making a serious mistake by trying to pass the spending bills on their own, and urged them to meet with White House officials and the Democrats to fashion a more bipartisan spending approach.

"We need to stop the music" and work out a new budget plan, declared House Minority Leader Richard A. Gephardt (D-Mo.). Senate Minority Leader Thomas A. Daschle (D-S.D.) said the Republicans are "digging themselves a hole that gets deeper and deeper."

Yesterday the House and Senate approved a "continuing resolution" to keep the government afloat through Oct. 21. The House approved the measure 421 to 2, and the Senate followed with a 98 to 1 vote -- with Sen. John D. Ashcroft (R-Mo.) voting no and Republican John McCain (R-Ariz.) absent. The White House said Clinton will sign the resolution.

With the new fiscal year scheduled to begin Friday, the move essentially buys more time for all parties to come to a consensus on next year's spending bills, without a politically embarrassing government shutdown. Congress has finished work on only five of the 13 annual spending bills, and only one of them, military construction, has been signed into law.

Complicating the effort to reach agreement on such bills is the looming 2000 election, in which control of Congress and the presidency will be up for grabs, and both parties are maneuvering for maximum political advantage.

House Republicans, for instance, are considering a multimillion-dollar ad campaign attacking Clinton and the Democrats for raiding the Social Security program to finance their spending initiatives. To try to buttress that point, the House voted 417 to 2 for a nonbinding, Republican measure urging lawmakers not to spend surplus Social Security funds on the other operations of government.

But Democrats belittled the GOP efforts, repeatedly touting a letter from the nonpartisan Congressional Budget Office indicating that the Republicans' spending policies already have eaten into next year's Social Security surplus and that as much as $27 billion may be consumed.

Rep. John M. Spratt Jr. (S.C.), the ranking Democrat on the House Budget Committee, said the Republicans' claim to be safeguarding the Social Security surplus was a "subterfuge" and a vain effort "to shift blame for failure."

Congress did make some progress on spending measures yesterday, reaching a compromise on the agricultural appropriations bill that would include $8.7 billion in emergency aid and drought relief for farmers. GOP leaders, however, did not go along with two provisions sought by farmers in some parts of the country, one lifting sanctions on food exports to Cuba and the other trying to help dairy farmers in the South and Northeast. A federal judge in Vermont, however, temporarily stopped new milk price rules that are opposed by the southern and northeastern dairy producers from taking effect on Friday. (Details, Page A16).

The decision on the dairy issue by House and Senate leaders, who declined to even call negotiators back in session to approve the agreement, left such northeastern lawmakers as Rep. James T. Walsh (R-N.Y.) bitter.

"They just said, `We're going forward, with or without you,' " Walsh said. "It's insulting." While spending differences between the two branches pose the greatest obstacle toward reaching a compromise, other factors could complicate a final budget agreement.

Lawmakers have attached an array of provisions affecting the environment to several bills, including measures preventing the administration from collecting higher royalties from oil companies, allow mining companies to dump more waste on federal lands, defunding international efforts to fight ozone depletion, and giving agencies the right to allow logging and road-building in national forests without first conducting wildlife surveys.

The administration has indicated it will veto the Interior and VA-HUD bills because of these provisions, known as "riders," and Democrats predicted Clinton would follow through on these threats.

"The administration is determined this year to be very tough," Rep. David R. Obey (D-Wis.) said of the environmental disputes. "They'll give when they don't think it hurts, but they're not going to give when they think they've got something important to defend."

House Majority Leader Richard K. Armey (R-Tex.), however, questioned why Clinton would risk jeopardizing the otherwise popular transportation spending bill by objecting to a provision blocking stricter emissions standards for light trucks and sports utility vehicles.

"We've already denied every soccer mom in the world her station wagon. Now we're going to deny her an SUV?" Armey asked.

Staff writers Helen Dewar and Charles Babington contributed to this report.