Republican leaders, ecstatic yesterday after the Senate narrowly voted to cut nearly $300 billion in proposed government spending over the next three years, cautiously predicted a favorable reception for their plan by the Democratic-controlled House.

Playing down the fact that it shifted priorities in President Reagan's budget by diverting funds from defense to domestic programs, they maintained that their plan would not hinder the administration's military buildup and, in a warning shot at the House, vowed to resist further defense cuts.

The Senate adoption of the budget resolution puts pressure on House Democrats to produce a blueprint that goes as far in reducing deficits. House Budget Committee Chairman William H. Gray III (D-Pa.) indicated yesterday that the House may make further cuts in the Defense Department buildup while rearranging certain domestic priorities to spread "the burden of spending cuts more fairly." House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) said he opposes tampering with Social Security.

"The importance was that something finally happened," said Senate Majority Leader Robert J. Dole (R-Kan.), clearly relieved after four months of intense effort paid off with victory by a one-vote margin in a groggy Senate in the early hours of yesterday morning.

"Sure it was close, but it happened," Dole added in reference to the fact that the plan was approved, 50 to 49, after Sen. Pete Wilson (R-Calif.) was wheeled into the Capitol on a hospital gurney to vote and then Vice President Bush had to break a tie to get the measure passed.

It was clearly a high-stakes personal victory for Dole in his biggest test since taking over as Senate Republican leader last January. Dole in turn credited Wilson, Budget Committee Chairman Pete V. Domenici (R-N.M.) and Sen. Edward Zorinsky (D-Neb.).

Zorinsky was important to Dole because he was the only Democrat to support the plan and because four Republicans -- Sens. Alfonse M. D'Amato (N.Y.), Paula Hawkins (Fla.), Charles McC. Mathias Jr. (Md.) and Arlen Specter (Pa.) -- voted against it, thereby wiping out the GOP's 53-to-47 Senate majority.

Zorinsky symbolized the high costs of passage, however. Zorinsky claimed credit for several billion dollars worth of farm-related spending that was restored to get his vote, and others not so bashfully claimed credit for saving funds for programs ranging from student loans to Amtrak and small business aid.

However, pressure from Democrats and dissident Republicans to excise the plan's most controversial feature -- a limitation on cost of living adjustments for Social Security recipients -- failed despite a historic skittishness on the part of Congress to tamper with Social Security.

The three-year deficit-reduction plan would cut projected spending by $295 billion by fiscal 1988, starting with $56 billion next fiscal year, according to figures used by the Republicans but challenged by Democrats, who contend the savings are somewhat less. Democrats argue that next year's deficit reduction is $43 billion, according to their figures.

The plan is aimed at cutting deficits -- which now exceed $200 billion a year -- by half within three years without increasing taxes.

Under Republican calculations, the budget plan would cut the projected deficit of $244 billion for fiscal 1988 to $104 billion. Next year's deficit would be $171 billion instead of $213 billion.

The plan is contained in a $965 billion congressional budget resolution for fiscal 1986, which sets out nonbinding targets for spending and taxes. It orders legislative committees to draft specific proposals for meeting the targets; these proposals subsequently would be incorporated in binding legislation. Under the plan, committees are directed to draft their proposals by the end of June.

The proposed spending cuts, believed to be unprecedented in size and scope, reflected not only mounting concern that persistently high deficits are threatening the economic recovery, but also a dramatic shift in priorities in Congress since Reagan took office nearly 4 1/2 years ago.

Although defense spending would continue to grow at the expense of social welfare spending along lines first proposed by Reagan in 1981, the plan approved by the Republican Senate goes farther than previous congressional budgets in narrowing the gap.

Within the nearly $300 billion in spending cuts approved for the next three years, the Senate shuffled funds that had been divided up differently in an earlier compromise between Republican Senate leaders and the White House. About $17.7 billion more was cut from defense and $15.7 billion added to domestic programs than had been agreed to in the earlier compromise.

First brushing aside Reagan's initial request for a defense spending increase of 6 percent over inflation and then rejecting a 3 percent compromise that GOP leaders negotiated with Reagan, the Senate insisted on limiting defense growth next year to what is required to keep pace with inflation.

This contrasts sharply with big after-inflation defense spending increases approved over the last four years and, according to many lawmakers, marks a plateau in the current military buildup, although funds approved earlier guarantee years of growth in the country's arsenal.

In addition to reversing the previous tide by shifting funds from defense to domestic programs, the plan stops well short of Reagan's goal for a permanent shrinkage of government by terminating many programs, rather than cutting them back.

The Senate agreed to wipe out a dozen of the 17 programs that Reagan recommended for extinction, but many of them were small, limited in scope or marked for termination in any case.

Among those that would be ended under the Senate plan are the Economic Development Administration, Appalachian Regional Commission, urban development action grants, most direct postal subsidies, revenue sharing with local governments (to be ended after fiscal 1986), Export-Import Bank direct loans, the community services block grant (also after 1986, although pressure is strong to revive it), trade adjustment assistance to firms, a travel and tourism office, work incentive program for welfare recipients and several other small programs.

Among those that would be cut but not eliminated are the Amtrak rail passenger service, the Job Corps, the Small Business Administration, federal impact aid to schools, the Rural Electrification Administration, mass transit subsidies and rural housing.

In addition, largely to pick up votes of wavering senators, the Senate restored about $3.3 billion of the $8 billion in farm-related spending cuts that had been negotiated earlier with the White House, including crop insurance, soil and water conservation and price support funds. Loan programs were expanded, and the administration agreed to use surplus commodities to subsidize trade promotion of U.S. agricultural products.

A "cap" on the federal contribution to Medicaid for the indigent was dropped, and proposed increases in premiums paid by elderly Medicare beneficiaries were scaled back, although payments to hospitals and physicians would continue to be frozen.

Drastic cuts proposed in the student loan program were derailed in favor of more modest ones, including limiting subsidized aid to students from families with annual incomes of no more than $60,000.

The Senate also voted to freeze the pay of all federal workers for a year, rather than, as Reagan proposed, cutting the pay of civilian workers by 5 percent while raising military compensation.

Overcoming intense political jitters about tampering with Social Security, the Senate for the first time put limits on cost-of-living adjustments (COLAs) by imposing a one-year freeze on Social Security benefits as well as all other government pension programs, including those for military and civilian government retirees.

But it stopped short of Reagan's proposal for a potentially long-term structural change that would have had the effect of approximately halving the inflation adjustment over the next three years.

Nonetheless, even if the Democratic-controlled House refuses to go along, the move was seen as a significant step toward tackling the difficult issue of containing costly benefit entitlement programs, which largely have escaped the spending retrenchment pattern of the last few years.

Although the Senate previously had rejected Reagan's Social Security formula when forced to vote on it separately, without the protective cover of the overall plan, it declined to back away from the cutback early today.

After passage of the plan as a whole, the Democrats made a last-ditch effort to restore full cost-of-living increases for Social Security but were defeated, 51 to 47. They also were thwarted on largely party-line votes in efforts to restore funds for Medicare and to impose a 15 percent minimum tax on corporations and high-income individuals.

Another tax proposal that was defeated, although with considerably greater pain, was one from Sen. Bill Bradley (D-N.J.) to restore Medicare money and offset the cost by reimposing an 8-cent-a-pack cigarette tax that is due to expire this year.

Largely out of loyalty to Reagan, who is opposed to tax increases, Senate Republican leaders had vowed to reduce deficits only through spending cuts. But many Republicans were clearly uncomfortable about pitting Medicare against tobacco, and several arms were twisted on the Senate floor to get a 49-to-47 vote rejecting the Bradley proposal.

In a telephone conversation with Reagan, who returned to Washington yesterday afternoon from Europe, Dole acknowledged he understood that the president was disappointed with the defense spending squeeze but promised "there could be some adjustments later on" if national security interests demand it.

Also, Domenici vowed to resist expected attempts from the Democratic House to whittle back the defense numbers even further.

He said he was "committed" to stick by the Senate's figures in conference with the House, which is expected to begin work on its plan next week.