In the end, the gray old bear who usually makes breakfast of Ronald Reagan lumbered down into the well of a bestilled House of Representatives and maybe, just maybe, pulled it out for his president.

"This is his legislation, and seldom do we agree," said Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), "but we do share a deep love for this country and a concern for its future."

There wasn't a sound in the big chamber and there was O'Neill, so often the adversary of the president, pleading and cajoling and lecturing to get this tax bill passed.

His big finger aimed toward the Republican side, singling out the GOP freshmen who rode into office, as he put it, on Reagan's coattails, and telling them to remember they were Americans first and politicians second.

Tough stuff, but it was that kind of day. The Democratic leader was plugging for the Republican president.

It was unfortunate, O'Neill conceded, that this vote came just "weeks before an election." And too bad, he said, that an economic course-correction had to occur. But, he ended, "The president is right and I ask for this vote."

On both sides of the aisle, members rose to cheer the speaker in one of his more remarkable oratorical moments.

The Republican leader, Rep. Robert H. Michel of Illinois, red-faced, agitated, flailing the air, followed O'Neill to the well, adding the asterisk that may have helped ease the tax measure on to victory.

Twenty-six years he had been in the House, Michel noted, and he'd never had to vote for a single tax increase. But it was the right thing to do so now, right for the country, Michel was saying, and the politics of it be damned.

So it went on one of those electric days that political Washington only occasionally gets to savor. The best theater in town was playing to a standing-room-only audience.

The tension, and you could feel it early, began in the morning as they debated the rule that would allow the House to move into debate of the bill. A key procedural vote was close, with several dozen rebellious Republicans waiting until time ran out to cast the politically protective "no" that might save them at home in November.

In the usual fashion, after the rule was adopted with ease, members took their turns at the microphones, having their say, praising each other, denouncing each other, and even getting off an occasional good line.

Rep. Henry J. Hyde (R-Ill.) tried to put it in terms that the "people's house," as it likes to call itself, could understand: "We have a $150 billion deficit staring at us with red, bloodshot eyes and we can't swat it down from Mount Olympus with a rolled up copy of the Wall Street Journal."

Rep. Leon E. Panetta (D-Calif.) went to the heart of the matter: the election-eve wavering and nervousness. Time had come, he said, to "stop this game of walking both sides of the street."

One of the Republicans at whom Tip O'Neill aimed his finger was Rep. Judd Gregg (R-N.H.), a conservative who rode into town last year thinking he and his right-thinking brethren would reform the place in a flash. Gregg said he came here with the idea of "slowing down government by denying it revenues."

That meant cutting budgets and it meant no tax increases. Yesterday he voted for a tax increase because, he said, seeing the reality of Washington, "we're moving in increments instead of single strokes" to whittle down government.

The hallway outside the chamber, the traditional roosting place for lobbyists, was teeming. The more visible included men from the tobacco companies, among them former House Ways and Means Committee chairman Wilbur Mills, now working the halls in behalf of Philip Morris Inc., which was up in arms over the cigarette tax increase.

The lobbyists squinted their eyes and honed in on the undecideds, of whom there still were dozens at mid-afternoon. When Rep. Steny H. Hoyer (D-Md.), the Prince George's County freshman, hove into view they fluttered from the roost.

A man from Philip Morris stepped into his path. "Steny," he said, with the tone of an old friend. "Ben Palumbo . . . . "

They talked a bit and then, as though he were a medicine ball, Hoyer was bounced toward another tobacco lobbyist. Back in the office, Hoyer's phones rang with calls from equally hungry federal workers.

Another lobbyist, Robert McIntyre of Citizens for Tax Justice, stood to one side with a bemused look on his face. "It's crazy. Ironic," he said. "This is the best tax reform bill in history. Ninety percent of it doesn't touch ordinary folks and all we're hearing is how it's going to hurt people."

But something had worked. As the final 15-minute roll call began, the "yes" votes piled up a quick and lasting edge. With 20 seconds to go, a cheer went up as the magic 218 for passage was reached. It was 222 to 200 when time ran out. Late votes and switches made it 226 to 207. With a few seconds to go, Hoyer cast his vote: no.