Congress' divisive, strongly felt and at times sharply political debate yesterday on U.S. support for Nicaraguan rebels took place under the shadow of two historical precedents: the Vietnam war, whose inglorious end 10 years ago is being commemorated this month, and communist control of Cuba, a thorn in the U.S. side a quarter-century after its revolution.

Those two situations, one far away and one close to home, provided much of the oratorical fodder as members of the House and Senate spent all day yesterday discussing the U.S. role in Nicaragua.

Opponents of "contra" aid, many of them Democrats, tended to describe U.S. support of the rebels as the first step toward a new Vietnam.

"The real issue," Sen. Patrick J. Leahy (D-Vt.) said at a high point of the Senate debate, "is whether Congress is going to sign a blank check for the president to lead this country to direct U.S. military intervention in a Central American war, a war the American people do not want." Others equated the pro-contra resolution with the Gulf of Tonkin resolution of 1964.

Proponents of the aid, led by Republicans, spoke more often of Cuba and the consequences of inaction.

House Minority Leader Robert H. Michel (R-Ill.) declared at the outset of debate that to "abandon the democratic force the rebels " would result in "starting the clock ticking toward an inevitable armed clash in this hemisphere." He said that, if the Sandinistas consolidate power in Nicaragua, "they will ultimately sell their nation to the Soviet Union the same way Castro sold Cuba."

What started as the "secret war" in Nicaragua is anything but a new issue on Capitol Hill. The Democratic-led House, whose intelligence committee expressed private reservations from the first, has voted three times in 21 months to cut off the contra aid and, despite heavy pressures from the White House and Senate, made it stick.

Last night's votes did little to change the previous pattern. Unless the administration can prevail on the House today to back a semblance of its program, the chances for a continuation of the contra aid seem dim for the foreseeable future.

One major difference this time is that the U.S. program is out in the open to a greater degree than ever. The increasingly thin veil of deniability has been dropped. The administration resolution before Congress yesterday would approve "the obligation and expenditure of funds available for fiscal year 1985 for supporting, directly and indirectly, military or paramilitary operations in Nicaragua."

Another difference has been Reagan's willingness to water down his programs and agree to last-minute compromises. He promised in a letter to the Senate shortly before the voting that none of the money would be used for ammunition or weapons even if Congress grants the $14 million he is seeking.

"The United States now stands at a moment of judgment," Reagan wrote. Even watered-down humanitarian support for the contras would over time "help the democratic center prevail over tyrants of the left or the right," he said. But abandoning the contras, he said, would "tolerate the consolidation of a surrogate state in Central America, responsive to Cuba and the Soviet Union."

For many lawmakers, political considerations vied with foreign-policy arguments, although less was said in public about the politics.

In the House, where the aid had been rejected repeatedly, Republican leaders had been telling the White House for weeks that major compromises were essential to preserve any vestige of the contra aid.

They had been through the battle so often that some House Republicans seemed more excited about the contested vote recount for Indiana's 8th Congressional District than about contra aid.

It was widely assumed in the Senate that the House would block the aid in any case, leaving senators more room to maneuver politically without being concerned about the practical consequences.

Conservative Democrats, especially from states looking south to Central America and Mexico, were reported concerned about taking the blame for thwarting a popular president on a question of war and peace in Nicaragua.

Vice President Bush, who joined Secretary of State George P. Shultz and White House national security affairs adviser Robert C. McFarlane in Capitol lobbying, argued that the important thing is not money for the contras but "the signal" that the vote will send about political support for U.S. policy in Central America. "It's not winning or losing . . . the question is the proper message," Bush told reporters.

At the end of last night's voting, the message was still uncertain.