The Senate early this morning approved an omnibus appropriations bill containing $7.6 billion in spending cuts needed to implement Congress' deficit-reduction accord with the White House and $9 million in new humanitarian aid for the U.S.-backed Nicaraguan contras.

Passage of the $606 billion measure came about 2:30 a.m. and completed initial Senate action on the two bills necessary to complete the Nov. 20 budget agreement that calls for a minimum deficit reduction this year of $30.2 billion. Final action came after more than 16 hours of debate.

Hard bargaining throughout the day and night yielded compromises on a range of foreign policy and military issues, including contra aid, the sale of Stinger missiles to Bahrain, a resumption of aid to Pakistan and development of the Midgetman missile.

The new aid to the Nicaraguan rebels through the end of February is to consist only of food, medicine, clothing and medical supplies, and could include as much as $6 million more to transport the assistance.

The Senate provision would allow that aid to be delivered by the Central Intelligence Agency through Jan. 17. If by that date a ceasefire is in place and the Sandinista government is in compliance with the Central American peace process that began in August, the aid could be, but would not be required to be, delivered by "nonpolitical, humanitarian international organizations" rather than the U.S. government.

The linkage to the Central American peace process was a concession to strong opposition to further contra aid in the House, which passed its version of the spending bill without including any new assistance to the rebels.

Also last night, the Senate accepted a compromise permitting sales of Stinger antiaircraft missiles to Bahrain for a period not to exceed 18 months. If approved by the House, that would clear the way for a planned sale by the Reagan administration of 60 to 70 of the shoulder-fired missiles to the Persian Gulf sheikdom at a cost of about $7 million. In addition, senators voted to allow the Reagan administration to resume sending up to $540 million in economic and military assistance to Pakistan if the president declares such aid is in the national interest.

Until October, when aid was suspended, Pakistan had been getting foreign assistance under a six-year waiver from current U.S. law that prohibits assistance to nations that have the capacity to produce nuclear weapons and do not submit to international inspection. Pakistan is believed to be developing a nuclear weapons capability.

Another amendment approved yesterday would delay by eight months any financial penalties on urban areas that fail to meet federal clean-air standards.

The provision would postpone until Aug. 31 sanctions against about 70 metropolitan areas that will not meet the Dec. 31 deadline for reducing ozone and carbon monoxide pollution. It is opposed by the Reagan administration, which has said the provision could trigger a veto of the spending bill.

The delay approved by the Senate is similar to a provision in the version of the omnibus spending bill adopted last week by the House. The postponement is designed to give Congress time to overhaul the Clean Air Act, which authorizes the Environmental Protection Agency to ban new construction and cut off highway and sewage treatment aid to cities that do not meet standards for ozone and carbon monoxide pollution.

The Senate also resolved a dispute over continued research and development funding for the Midgetman missile, a mobile, single-warhead intercontinental ballistic missile that the Senate Appropriations Committee had earlier voted to discontinue.

Under the compromise sponsored by Senate Armed Services Chairman Sam Nunn (D-Ga.), the bill authorizes $100 million for the Midgetman but delays any expenditures for both that system and its rival, the rail-based MX multiple warhead missile, until Feb. 25, 1988. In addition, the Pentagon is required to tell Congress which weapon it prefers by Feb. 1 and disclose estimates of the systems' costs and survivability.

Resolution of the clean air and Midgetman controversies came as the Senate slowly worked its way through more than 150 potential amendments to the spending measure that authorizes $606 billion to fund most government operations for the remainder of the fiscal year, which ends Sept. 30. The legislation incorporates all 13 appropriations bills normally used to fund the government, none of which has been passed by Congress this year.

The spending bill calls for $7.6 billion in discretionary spending cuts, $5 billion from military accounts and the remainder from domestic programs such as education and law enforcement.

The Senate early yesterday passed the other measure needed to implement the budget accord, a tax and spending-cut bill that would trim the deficit by another $26 billion through a $9 billion tax increase, a variety of spending reductions, asset sales and user fees.

The House has already passed its versions of both deficit-reduction measures, and Senate approval of the appropriations legislation would clear the way for conference committees on both bills early next week. Congressional leaders are anxious to complete action on the deficit package next week so they can adjourn for Christmas.

"Jingle bells are ringing and Hanukah lights are gleaming," said Sen. J. Bennett Johnston (D-La.), as he floor-managed the bill through dozens of amendments, including some that were special favors.

Sen. Frank R. Lautenberg (D-N.J.), who faces a tough reelection battle next year, convinced the Senate to accept an amendment allowing Hoboken, N.J., to defer its classification as a "metropolitan city," thereby allowing it to continue receiving Community Development Block Grants under its previous designation as an "urban county."

Sen. Quentin N. Burdick (D-N.D.), chairman of the public works committee, who also faces reelection, won some highway projects and funding for a university transportation center.