A long and increasingly disruptive government shutdown ended early this morning three weeks after it began when President Clinton signed legislation that brings back to work hundreds of thousands of workers furloughed during Washington's budget impasse.

With many congressional Republicans acknowledging that the partial shutdown had become a political liability to them, both the House and Senate passed bills yesterday to send 280,000 federal employees back to work. Another 480,000 workers who have been required to work without pay since the shutdown began Dec. 16 will be paid through Jan. 26.

"In my view, we have a resolution now to a very thorny problem and one that unfairly punished a lot of good people," Senate Majority Leader Robert J. Dole (R-Kan.) said after the Senate approved by voice vote the compromise bill worked out by House GOP leaders Thursday night.

But the measure falls far short of a full reopening of the government because it funds only a limited number of critical activities. And it leaves open the possibility of another shutdown in three weeks if Clinton and GOP congressional leaders do not agree on a seven-year plan to balance the budget.

White House aides said late yesterday that there would be "intensified" discussions between Clinton and the GOP leadership this weekend and signaled that the president soon expects to endorse such a plan -- something he had steadfastly refused to do during the 21-day shutdown.

Clinton yesterday called the GOP strategy of closing the government "cruel and unusual punishment not only for all the people who need those services, but for all the rest of the people in this country who get them."

About a dozen targeted programs, including Meals on Wheels for seniors, the National Park Service's visitor centers and museums, the passport office, foster care and adoption assistance, the administration of unemployment assistance and Aid to Families with Dependent Children would receive full funding. Most of the programs would be funded through the end of the fiscal year, Sept. 30.

Under pressure, Republicans yesterday added to that list, voting to fund numerous law enforcement agencies, the National Institutes of Health, the Centers for Disease Control and Prevention, the Peace Corps, Gallaudet University and programs such as FHA loans and benefits for miners with black lung disease.

Many workers will return to their jobs but have little if anything to do because the legislation does not provide operating funds for their agencies. Nine Cabinet departments and 38 agencies and commissions have been without funding since Oct. 1 because the president and Congress have not agreed on their budgets.

The legislation was a major concession by House GOP leaders and an acknowledgment that their strategy until now of linking the fate of federal employees to White House concessions on a balanced budget had failed.

But Republican leaders insisted yesterday that they had not lost their leverage in forcing the president to come forward with a plan to balance the budget in seven years. After a two-hour meeting with Clinton at the White House yesterday, Dole and House Speaker Newt Gingrich (R-Ga.) said Clinton might present this weekend a detailed balanced budget plan, using congressional spending and economic estimates.

"It is our hope that the president will submit a balanced budget either tomorrow or Sunday," Gingrich told reporters after the meeting. He said if Clinton did that, "we would then have the full government operating by Monday morning."

A second bill Congress approved yesterday would reopen all of the programs run by the departments and agencies affected by the shutdown through Jan. 26 if Clinton submits a balanced budget using congressional spending and economic estimates. This companion piece was offered by Gingrich in response to more militant GOP members who have grown frustrated with Clinton and the pace of the budget talks.

House Appropriations Committee Chairman Bob Livingston (R-La.) warned the White House and congressional Democrats that "the crisis is not over" and could flare up again unless Clinton honors the seven-year balanced budget pledge.

The White House said Clinton is preparing to do just that. "The president indicated {to GOP leaders} that the elements are there and it should be possible" for him to endorse a plan based on forecasts from the Congressional Budget Office, one senior administration official said.

This official said Clinton's latest plan could come from the various Democratic and bipartisan budget alternatives to the Republicans' that are already "on the table." "It's not an issue of laying down something new but picking up from the table" parts of various proposals that "reach the goal of a balanced budget as measured by Congress."

Clinton's new approach led to what administration officials called an "intensified schedule" of talks at the White House through the weekend. This schedule includes a three-hour session today, day-long meetings beginning at 9:30 Sunday morning and a 2 p.m. session Monday. "They agreed to intensify and get the job done quickly," said White House press secretary Michael McCurry, adding that even this faster pace isn't likely to produce an accord by Monday.

Several hours after the White House meeting ended, House GOP leaders and a group of conservative Democrats announced they had agreed to a compromise plan for overhauling Medicare that would save $168 billion over seven years -- a substantial drop from the $226 billion of savings the Republicans have previously proposed.

Republicans have sought to pressure Clinton by pursuing separate talks with conservative Democrats about a compromise budget. House Budget Committee Chairman John R. Kasich (R-Ohio) declared the agreement a "major breakthrough" and said it "sends a very strong signal to the White House" that Republicans are willing to be flexible about one of the most sensitive issues in the budget talks.

The GOP bill to bring back the workers was immediately accepted by the White House and Democratic congressional leaders despite their criticism of the "goofy" and patchwork approach to restoring government services.

"This isn't the way to run a government," Senate Minority Leader Thomas A. Daschle (D-S.D.) said yesterday. "Now, we're picking and choosing. Now, we're picking winners and losers. Now, we're still leaving unfunded many major programs, including Head Start and cops on the street."

But White House aides did little to disguise their satisfaction with the Republicans' abrupt change of strategy. "They've relented because basically this strategy has backfired on them," McCurry said.

House GOP leaders who had linked the fate of the furloughed employees to progress in the Republicans' budget talks with Clinton acknowledged yesterday that their strategy had failed and that new tactics were called for. "We have always had to swallow a little," Kasich said.

Despite polls showing that Americans blamed Republicans more than the president for the government shutdown, House Republicans stubbornly stuck to their strategy until this week, when Dole and Senate Republicans grew wary of the growing controversy over the shutdown and adopted a measure that would have allowed the government to temporarily resume full operations.

House Majority Leader Richard K. Armey (R-Tex.) and House Majority Whip Tom DeLay (R-Tex.) vowed to continue the shutdown until Clinton showed a willingness to bargain in earnest and blamed Dole for "caving" to political pressure when he proposed a temporary spending bill to reopen the government.

But Gingrich declared a red alert beginning late Wednesday, when it became apparent that nearly two dozen House Republicans -- including Washington-area members with large numbers of federal workers in their districts -- were on the verge of a revolt that would have shifted power to Democrats to pass legislation reopening the government.

After conducting marathon closed-door meetings with other leaders, a vocal group of freshmen and other rank-and-file members through late Thursday, Gingrich yesterday morning cracked the whip at a meeting of the Republican Conference and demanded that the members fall into line behind his plan for temporarily ending the shutdown. "This is a team and let's act like a team," he declared.

Rep. Thomas M. Davis III (R-Va.), one of several Washington-area Republicans who represent large numbers of federal workers, said, "It's time to get the hostages off the plane" and "if we can't get a clean CR {continuing resolution}, then this is the next best thing." DeLay, bowing to political necessity, said, "Republicans will never surrender in our effort to balance the budget, but we will not keep the federal workers on the firing line when it's Bill Clinton who ought to be fired." Staff writer Helen Dewar contributed to this report. CAPTION: DISSENTERS IN HOUSE

The House approved, 401 to 17, a Republican plan to send furloughed federal employees back to work while leaving many government functions without money. Voting no were 15 Republicans and two Democrats. REPUBLICANS

Barr (Ga.), Barton (Tex.), Chabot (Ohio), Chenoweth (Idaho), Dickey (Ark.), Ganske (Iowa), Graham (S.C.), Hoekstra (Mich.), Hostettler (Ind.), Largent (Okla.), Sanford (S.C.), Shadegg (Ariz.), Smith (Wash.), Souder (Ind.) and Tiahrt (Kan.). DEMOCRATS

Gibbons (Fla.) and Hastings (Fla.). ec CAPTION: THE REOPENING PLAN

The plan passed by the House and Senate would provide back pay to Dec. 16 for the 760,000 workers who have lost pay and would pay their salaries through Jan. 26. All furloughed employees would go back to their offices, but many would not have the funds to carry out their activities.

In addition to paying salaries, it would fund the following programs through Sept. 30, 1996: Operation of the District of Columbia with its own money Meals on Wheels nutrition for the elderly Child welfare, including parent locator service Administration of unemployment insurance Assistance for Native Americans Railroad retirement payments Visitor services in the National Park system and Bureau of Land Management, wildlife refuges and U.S. Forest Service facilities Cultural institutions including the National Gallery of Art, the Smithsonian, the Kennedy Center and the Holocaust Museum Passport, visa and U.S. citizen services abroad Veterans compensation, pension and education programs Black lung benefits Gallaudet University elementary and secondary schools Department of Justice law enforcement Peace Corps volunteers Department of Labor trade adjustment benefits Payments to contractors handling Medicare claims Medicaid payments to states Small Business Administration financing, training and counseling Federal Housing Administration loan processing for families Federal Emergency Management Agency food and shelter program State Department diplomatic security National Institutes of Health Centers for Disease Control and Prevention Public Health Service Commissioned Corps medical benefits and retirement pay It would fund the following programs to March 15: Aid to Families with Dependent Children Foster care and adoption assistance to states UNFUNDED PROGRAMS

All other programs would be unfunded in the following departments:

Commerce, Interior, State, Education, Labor, Health and Human Services, Housing and Urban Development, Veterans Affairs, Justice and foreign aid.

Agencies for which funding is held up include the Environmental Protection Agency, the Securities and Exchange Commission and NASA. EXEMPT DEPARTMENTS, PROGRAMS

Funding previously was enacted for:

Agriculture, Energy, Defense, Transportation, Treasury, the White House, Congress and the Postal Service.

-- Reuter ec CAPTION: House Speaker Newt Gingrich talks to reporters after GOP caucus on legislation to end partial government shutdown. ec