The Senate finally closed out the 97th Congress yesterday when it adjourned after shutting off an acrimonious two-week filibuster and approving a highway bill that raises the federal gasoline tax by a nickel a gallon.

In a morning of bitter attacks on the legislation's most stubborn opponent, conservative Sen. Jesse Helms (R-N.C.), and laments about the frustrations of the lame-duck session, the Senate passed the gasoline tax increase by 54 to 33.

President Reagan congratulated congressional leaders for pulling the bill through and said he would sign it into law soon.

In the last speech delivered before the climactic vote, Sen. George J. Mitchell (D-Maine) summarized the feelings of many of the exhausted and frustrated senators on hand by quoting Oliver Cromwell's words to the British parliament in 1653:

"You have sat too long for any good you have done. Depart, I say, and let us be done with you. In the name of God--go!"

The nickel-a-gallon increase, raising the federal tax on gasoline to 9 cents, will take effect in April. It could cost the average American motorist an extra $30 a year, although oil industry experts this week said the market is so soft that prices may not rise.

The vote to end the filibuster against the bill was an overwhelming 81 to 5 as weary senators, anxious to get home for the holiday season, vented their wrath on Helms and praised Majority Leader Howard H. Baker Jr. (R-Tenn.). In standing firm against Helms and finally prevailing, Baker reasserted his control in the Senate.

Five senators were flown back to Washington on government planes to vote to end the filibuster, prompting a defeated Helms to lament: "The sky was dark with Air Force planes. Nobody knows what that will cost. It's another case where the poor taxpayer is required to finance his own misery." Before the vote, one senator after another rose to criticize Helms and the rules that allowed his filibuster to tie up the highway legislation -- and the Senate -- for much of the lame-duck session of Congress.

Sen. Edward M. Kennedy (D-Mass.), who in the end voted against the gasoline tax, said he was so infuriated by the filibuster that he would support any measure to strip Helms of his chairmanship of the Agriculture Committee.

"We are not debating war and peace, or a new world order, or whether all people are created equal. We are talking about the width and weight of trucks, the potholes in our country roads, and the failing subways in our ailing cities," Kennedy said. "That is the poor stuff of which this ridiculous debate is made, and we deserve all the ridicule we are receiving, because all our wounds are self-inflicted . . . . We have too easily permitted this historic chamber to become the laughing stock of the nation."

"I appreciate every word Sen. Kennedy said," Helms responded. "His statement may have increased my popularity in North Carolina by 10 to 12 points."

Sen. Wendell H. Ford (D-Ky.) said Helms and his Republican compatriot from tobacco-rich North Carolina, Sen John P. East, had created so much ill will in the Senate that they placed all future bills dealing with the tobacco industry in "the greatest jeopardy." And Sen. Dennis DeConcini (D-Ariz.) said the Senate had been "tyrannized and immobilized by a handful of men."

The complaints became so bitter and partisan that Sen. Robert J. Dole (R-Kan.), floor leader of the bill, felt compelled to defend the party colleague who had frustrated his efforts to pass the bill. Dole noted that Ford is the chairman of the Democratic Senate Campaign Committee and that Helms would be facing a tough reelection challenge from North Carolina Gov. James B. Hunt, a Democrat, in 1984.

"There's a lot of acrimony, a lot of politics," Dole said. "Everybody is piling it on Jesse Helms. That may be great fun, but it's not very effective."

Yesterday's vote on the compromise gas-tax bill, which emerged from a conference committee Tuesday and was approved quickly by the House of Representatives the same night, was almost identical to one taken on the Senate version of the bill earlier in the week.

Once again the opposition consisted of an unusual coalition of liberals from the industrial states and conservatives from rural and western states.

Among local senators, John W. Warner (R-Va.), Harry F. Byrd Jr. (Ind.-Va.) and Charles McC. Mathias Jr. (R-Md.) voted for it, while Paul S. Sarbanes (D-Md.) voted against it.

The only senators to oppose the move to end the filibuster -- which featured 54 hours of speeches, 53 amendments, and 29 votes -- were Helms, East, William Proxmire (D-Wis.), J. James Exon (D-Neb.) and Don Nickles (R-Okla.). Sen. Gordon J. Humphrey (R-N.H.), who joined Helms in trying to talk the bill to death over the past two weeks, was not present for the votes yesterday.

Exon argued that the hostility so evident in the Senate this week should have been directed not at Helms and the bill's opponents but "at the White House, which needlessly asked us to pass this non-emergency measure in so short a time."

One of the five senators flown to Washington in an Air Force plane was Barry Goldwater (R-Ariz.), who spent the lame-duck session in Arizona recovering from triple-bypass heart surgery.

Goldwater, who has had his differences with the Helms' faction on the far right of the Republican Party, voted to end the filibuster, saying, "When you know you're whipped, you should quit."

The frustrations of the past month were such that both Helms and Baker, the main antagonists in the Senate showdown, ended up agreeing that everyone might have been better off if the lame-duck session that Reagan had requested had never been held.

"I was never for it," said Baker, after making the traditional telephone call to Reagan to end the session, which was accompanied by quacking noises from a large group of bystanders. "Frankly," Baker said later, "I recommended against this session."

"It was silly as a 10-cent watch," Helms said. "The lame-duck session never ought to have been called. It was a tragic mistake, and I felt that way when it was called."

Along with raising the federal gasoline tax, the highway bill significantly increases the levy on heavy trucks, repeals the tax on lighter trucks and, in a concession to the trucking lobby, increases the maximum lengths and weights of trucks. The bill also extends unemployment compensation benefits an extra two to six weeks, one of the few actions taken by Congress during the lame-duck session that was of direct benefit to the nation's 12 million unemployed.

While refusing to call the gasoline tax-highway bill a jobs measure, the White House estimated that the program to reconstruct and repair the nation's highways and mass transit systems would create 320,000 jobs. But some administration economists have argued that nearly as many jobs might be lost because of the financial burden the new taxes would put on businesses.

In the end, aside from a few appropriations bills and a continuing resolution that significantly increases military spending while deleting production funds for the controversial MX missile, the gasoline tax was one of the few major pieces of legislation that survived the fractious lame-duck session.

Democratic measures to create hundreds of thousands of new jobs in government public works projects passed both houses, but were eliminated by a conference committee faced with a veto threat by Reagan.

Once that was done, a large number of Democrats wrote off the session as a waste of time and looked forward to the opening of the 98th Congress next month, when they will have 26 more votes in the House.

The White House also came out a loser on several measures it backed, including the Caribbean Basin Initiative to ease trade and tariff arrangements with most Latin American countries and the payment-in-kind farm bill intended to curtail production and bolster crop prices.

Both measures were approved by the Democratic-controlled House, but could not get through the Senate in the final boisterous days.

The administration's relatively modest impact on the workings of the lame-duck session were in striking contrast to the successes it had when the 97th Congress began.

In its early stages, the Congress, at Reagan's behest, enacted the largest tax cut in American history and severely slashed domestic spending. But some of the social welfare cuts were restored over the past year over the opposition of the White House, and the tax agenda during the final year of the session was set more by moderate Senate Republicans than by Reagan.

It was Baker and Dole who persuaded the president to go along first with the largest tax increase in history a year after cutting taxes, and they were the moving forces, along with Transportation Secretary Drew Lewis, in pushing the gas tax increase.