The Senate passed a $606 billion omnibus appropriations bill early yesterday after a 17-hour session, propelling the Democratic-controlled Congress into the stretch run toward enactment of a budget pact with the Reagan administration that calls for a $30.2 billion reduction in the fiscal 1988 federal deficit.

The 72-to-21 vote, at 2:51 a.m., paved the way for House-Senate conference committees to begin work Monday on compromise versions of two bills implementing the ov. 20 accord. The other legislation, known as budget reconciliation, also has passed both houses in differing forms.

The appropriations legislation passed yesterday, known as a continuing resolution, funds most government operations through the remainder of this fiscal year. It provides for about one-fourth of the deficit reduction called for in the budget agreement by cutting $5 billion in defense spending and $2.6 billion from domestic programs.

The vote capped a remarkable 17-hour day in which the Senate not only passed the largest single spending bill in its history but set the stage for eventual settlement of several contentious foreign policy and military issues.

Foremost among them was the always-nettlesome subject of further aid to the Nicaraguan contras. Against a backdrop of the ongoing Central American peace process and conflicting accounts that Soviet leader Mikhail Gorbachev may have offered a deal to President Reagan during their summit talks for a suspension of Soviet aid to the Marxist Sandinista government, the Senate voted to send $9 million in humanitarian aid to the Nicaraguan rebels.

But in approving further contra aid through the end of February, the Senate has merely staked out a bargaining position for its upcoming conference with the House, where opposition to additional aid runs strong and where the Democratic leadership kept any new aid out of their version of the spending bill.

During a sometimes angry debate early yesterday morning, the Senate rejected an attempt by Sen. John F. Kerry (D-Mass.) to make delivery of the assistance contingent on certification by three of the five Central American presidents that further aid is consistent with the peace process.

Instead, the Senate approved the $9 million, plus as much as another $6 million to cover the costs of transport, and said it could be funneled through humanitarian international organizations if a Nicaraguan ceasefire is in place by Jan. 17 and the Sandinista government is in compliance with the Aug. 7 Guatemala accord that set the peace process in motion. The aid is limited to food, medical supplies, clothing and shelter.

The tenuous linkage with the peace process that is so dear to the heart of House Speaker Jim Wright (D-Tex.) is unlikely to satisfy the House. "That doesn't tie it to anything, and it's a big amount of money as well," said one House leadership aide. "The language is certain to be significantly altered in conference."

Despite the hard bargaining ahead, lawmakers predict that Congress can wrap up the budget agreement and send it to the president's desk by next weekend.

"That Christmas spirit can be a powerful thing," said Sen. J. Bennett Johnston (D-La.). "The conferences have a lot of tough issues, but there's no reason they can't be handled."

Conference agreements on the two deficit-reduction measures and their subsequent final approval by both houses would cap a two-month effort by the Reagan administration and Congress to respond to the Oct. 19 stock market collapse by agreeing to a bipartisan plan to stop the growth of the federal deficit. Under the pact reached Nov. 20, Reagan and congressional leaders agreed to the broad outlines of a deal to cut the deficit by $30.2 billion in the fiscal year that ends Sept. 30. Even that, however, would leave the federal deficit close to the $148 billion level of last year.

The omnibus spending bill passed by the Senate yesterday provides for $7.6 billion of the deficit reduction by cutting defense spending $5 billion and discretionary domestic spending programs such as education by $2.6 billion. That legislation incorporates the 13 regular appropriations bills needed to fund most government operations through September, none of which have been passed separately by Congress.

The Senate version of the second measure, the reconciliation bill, slices another $26 billion off what the deficit would otherwise be without any government action by combining a $9 billion tax increase with a variety of cuts in permanent federal programs such as Medicare, farm subsidies and veterans benefits, $7.5 billion in federal asset sales and miscellaneous savings through user fees and tougher tax collections.

In passing the appropriations bill, the Senate considered more than six dozen amendments, adopting 68. They included grand expressions of U.S. foreign policy as well as special favors for individual senators' states.

Among the more important amendments were:To permit a short-term sale of Stinger antiaircraft missiles to the Persian Gulf sheikdom of Bahrain. Any of the shoulder-fired missiles that have not been used up after 18 months would have to be sold back to the United States, sooner if another U.S. air defense system is available. The action, if approved by the House, would clear the way for the Reagan administration to sell 60 to 70 of the missiles to Bahrain for about $7 million. To allow the resumption of up to $540 million in military and economic aid to Pakistan despite evidence that that nation is building a nuclear-weapons capability. Such aid has been suspended since the end of September, when a six-year waiver permitting aid lapsed. Under the waiver, which could be extended for another six years on an annual bsais under the Senate language, Pakistan was exempted from a U.S. law that prohibits assistance to nations capable of producing weapons that do not submit to international inspections. To delay by eight months, until Aug. 31, financial sanctions against more than 60 metropolitan areas that do not meet federal clean air standards for two pollutants, ozone and carbon monoxide. The sanctions, including possible bans on construction and a cutoff of highway and sewage funds, were to take effect at the end of this year. The delay affords Congress an opportunity to rewrite the Clean Air Act. To reverse a Senate Appropriations Committee decision to terminte research and development funding for the Midgetman missile, a mobile, single-warhead intercontinental ballistic missile. The Senate voted to authorize, but not yet spend, $100 million for the missile pending a Pentagon decision on whether to deploy it or a rail-based version of the multiple-warhead MX.