The 98th Congress adjourned yesterday after absentee senators were summoned back to Washington aboard Air Force jets and hastily arranged commercial flights to pass an urgently needed debt-ceiling extension rejected in a surprise vote Thursday night.

As an angry, frustrated and embarrassed Republican leadership pulled out all stops to pass the measure, 41 Republicans showed up, and 37 voted to pass the measure. The other four joined all 26 Democrats in the chamber at the time in voting against.

With the bill safely on its way to the White House for President Reagan's signature, the Senate and House adjourned the tumultuous session shortly after 3 p.m.

The Senate laid aside its rule against applause to say farewell to Majority Leader Howard H. Baker Jr. (R-Tenn.), retiring after 18 years. Members gave him a lengthy standing ovation, after having roughed him up only hours earlier on the debt bill.

The measure, already passed by the House, was needed before adjournment because the government ran out of borrowing authority when it hit its legal debt ceiling of $1.573 trillion earlier this month. The bill raises the debt limit to $1.824 trillion, presumably enough to last through next September.

Democrats, chafing under GOP campaign criticism for their support of debt-extending measures, often have withheld votes for debt bills in recent years to force Republicans to take the lead in passing the measures. Democrats normally provide enough votes in the end for passage; this time they did not, and the bill failed, 46 to 14, on its first try.

"It's like playing Russian roulette, and this time the gun went off," a Senate Republican leadership aide said.

Baker, who had hoped to adjourn the Senate late Thursday night after passing the debt measure, quickly recessed the Senate when it failed and set about trying to round up senators who had left for vacations or pre-election campaigning.

With aid from the White House, three Air Force jets were sent to pick up at least four Republican senators: William S. Cohen of Maine, Jeremiah Denton of Alabama, Thad Cochran of Mississippi and John G. Tower of Texas, all of whom voted for the bill. One of the jets stopped for Sen. Charles H. Percy (R-Ill.), but he stayed in Illinois to campaign for reelection.

A dozen or more other Republicans came back by commercial aircraft. Democrats were left to fend for themselves, and 15 of them returned on their own.

"This is the most ridiculous thing I've ever seen," said Sen. James Abdnor (R-S.D.), who made a quick round trip from Sioux Falls wearing the same clothes he left in the previous day because his luggage was waylaid along the line.

But Democrats were enjoying their pound of political flesh.

"For four years, Republicans have always made us pass a debt limit, then they campaign against it," Sen. Daniel Patrick Moynihan (D-N.Y.) said. "Here it's their debt limit. Let them pass it."

"Republicans want to say deficits don't make any difference and then they blast the Democrats when they vote to extend their debt," Sen. Patrick J. Leahy (D-Vt.) said. "You can't have it both ways."

Baker, whose hopes of retiring in relative peace had been dashed by the last-minute surprise, was taking no chances. Before the vote, he won passage of a new adjournment resolution that could have kept Congress in session through next Friday, and he served notice that he wouldn't bring up the bill until he knew he had the votes.

"We're either going to have enough votes that I'm going to win or we ain't gonna have a vote," he said.

In the end, the Democrats succeeded in flushing out the Republicans, if nothing else. Of the 41 Republicans who voted, only four -- Gordon J. Humphrey of New Hampshire, Nancy Landon Kassebaum of Kansas, Robert W. Kasten Jr. of Wisconsin and Don Nickles of Oklahoma -- opposed the debt-ceiling extension.

Sen. Russell B. Long (D-La.), the only Democrat who voted for the bill the previous night, was absent.

For the Republican-controlled Senate, the debt controversy was the last in a series of snarls, ranging from civil rights legislation to a real estate taxation measure, that tied it in knots at the session's end and tarnished the leadership's reputation for efficiency.

Paradoxically, defeat of the debt measure Thursday night meant that the Senate, only hours after belatedly passing legislation that sanctioned hundreds of billions of dollars in government spending, refused to pass legislation to pay the creditors.

After the vote, Baker and Senate Minority Leader Robert C. Byrd (D-W.Va.) made their traditional telephone call to the president to tell him that Congress had finished its business and to ask whether there were any loose ends he wanted tied up.

Both appeared relieved that Reagan had no further suggestions. Asked earlier what he would do if Reagan had any last-minute ideas, Baker said, "We'll reason together."

Earlier, as Democrats and Republicans joined in praising Baker's leadership, he returned the praise, insisting, despite some skepticism in the ranks, that the Senate really does work after all.

At the end, Baker announced in a tone of relief that there would be "no more votes today, no more votes this session and no more votes in my career." Baker, 58, is considering a race for the GOP presidential nomination in 1988.

Also honored were Sen. Jennings Randolph (D-W.Va.), who is retiring at age 82 after 52 years in the House and Senate, and two other retiring senators, Tower and Paul E. Tsongas (D-Mass.).

With threats of a post-election "lame-duck" session removed by Congress' completion of its work this week, the House and Senate will not return until the 99th Congress convenes Jan. 3.