Congress, with three minutes to spare, passed and sent to the White House the remaining appropriations bills but not in time for President Reagan to sign them before the fiscal year expired at midnight.

In a race against the clock, the Senate gave final approval to the $14.3 billion foreign aid appropriations bill just before the deadline after giving way to the House on three amendments.But Reagan, returning from a day of campaigning for Republican vice presidential candidate George Bush, abandoned plans for a symbolic signing of the bills, refusing to believe that Congress would finish in time.

Until the very last moment, Congress appeared to be stymied by the foreign aid bill.

An impasse began when the Senate attached amendments imposing sanctions on Iraq for use of chemical weapons, a ban on U.S. aid to China's missile program unless the president certifies no missiles are being sold to a number of Middle East nations and new restrictions on the use of immunity by foreign diplomats stationed in the United States.

The House, warned that the additions would cause "great heartburn" in the administration and facing the possibility of a veto, quickly killed off the three amendments and sent the bill back to the Senate.

When the bill returned, Senate Democratic leader Robert Byrd won quick approval to ditch the amendments in a frantic effort to finish before the midnight finish.

Reagan and Congress both hoped to complete action and have the president sign the bills - the first time that would have occured in 40 years. In 1977, Congress sent the bills to the White House in time but they were not all signed before the end of the fiscal year.

Reagan has signed seven of the 13 annual appropriations bills. The other six are now waiting his signature with indications that all are acceptable to him.

Congress, bouncing the bills from one chamber to another, stayed in session late, attempting to complete action on the measures in last-ditch haggling between the Senate and House.

In a hectic day, Congress approved and sent to the White House the $283 billion defense appropriations bill that includes $27 million in non-military aid to the Contra forces in Nicaragua; the $46.5 billion agriculture appropriations bill for farm and food programs; the $537 million appropriations bill for the District of Columbia; and the $1.4 billion legislative appropriations bill to run Congress.

Also at the White House waiting Reagan's signature was the $14.8 billion money bill for the departments of state, justice and commerce and the federal judiciary which was sent Reagan earlier in the week.

Rep. Silvio Conte, R-Mass., said, "Today is a historic day of Olympic proportions. Today is a day that shatters myths, counters our critics and ends many winters of discontent,for the first time in the modern era the federal budget is in place, on time."