Around midnight, Sen. Tom Harkin got up from the cane-backed chair and stood on the veranda at the home of Foreign Minister Miguel D'Escoto. For a moment, the tropical breeze softened the harsh realities he and Sen. John Kerry were facing inside with Nicaraguan President Daniel Ortega and D'Escoto.

Harkin (D-Iowa) and Kerry (D-Mass.) -- who came here trying to extract agreements for peaceful negotiations from Ortega before today's congressional votes on "contra" aid -- say the echoes of Vietnam are everywhere.

For the first time, the Senate has three Vietnam-era veterans who returned deeply opposed to that war -- Kerry, Harkin and Albert Gore Jr. (D-Tenn.). Kerry got three Purple Hearts and returned to lead Vietnam Veterans Against the War, stunning the Senate Foreign Relations Committee he now serves on by asking the question, "How do you ask a man to be the last man to die for a mistake?" Harkin flew planes in the Vietnam theater and, as a congressional aide in 1970, exposed the infamous tiger cages where prisoners were tortured by the South Vietnamese. Now, 15 years later, they were in Nicaragua, trying to avoid what they see as another Vietnam.

"Look at it," Kerry said as their plane touched down here Thursday night. "It reminds me so much of Vietnam. The same lushness, the tree lines."

Driving into town there were more similarities: corrugated tin roof huts, the sad architecture of Third World countries -- the smell of wood burning. "And the poverty."

The political parallels between Central America and Southeast Asia are not exact, they say, but both men, from dissimilar backgrounds, have come to the same place politically because of Vietnam. And they see disturbing similarities. For the first time, a U.S. president is publicly pushing Congress to fund guerrilla attacks on a country with which the United States is not at war.

"If you look back at the Gulf of Tonkin resolution," Kerry said, "if you look back at the troops that were in Cambodia, the history of the body count and the misinterpretation of the history of Vietnam itself, and look at how we are interpreting the struggle in Central America and examine the CIA involvement, the mining of the harbors, the effort to fund the contras, there is a direct and unavoidable parallel between these two periods of our history."

"Once again," said Harkin, "a president is relying on deception, distortion and duplicity to garner support for an unpopular policy, a policy not supported by the American people, for intervention in an underdeveloped country."

The land is swirling with divergent views, and the senators listened to many of them. They heard tales of repression from anti-Sandinista businessmen and politicians. They listened to Sandinista leaders who said all censorship and economic suffering would abate if only Reagan would stop funding their enemies. They talked to a pro-contra archbishop and to priests who told of contra atrocities. Many voices in a nation of fewer than 3 million.

The senators had been getting blips all day of news from Washington: Reagan, facing defeat in the House and a close call in the Senate, might seek a compromise, might ask for only "humanitarian" aid. "Seems to me Reagan has made one hell of a political mistake," said Harkin. Bumping along on the way to one meeting, Harkin caustically said: "Do you really think the CIA plans to set up soup kitchens along the Honduran border?"

Now, at midnight, Harkin rubbed his eyes and returned to the meeting that began at 6 p.m. and would last until 1:30 a.m. In the hall he noticed a frail old woman saying her rosary. Such an odd touch, thought Harkin, to the disconcerting language of war they were all speaking. She was Miguel D'Escoto's 85-year-old mother.

In addition to being foreign minister, D'Escoto is a priest. What Ortega Said

In Managua itself, there is the look of war, but it is deceptive -- merely the cracked and crumbled ruins that remain unrestored from the 1972 earthquake. On Friday, earthquake tremors rattled keys hanging on the wall at the U.S. Embassy. The quake registered 6.5 on the Richter scale.

The city is about four hours by car from the war zone, close to the Honduran border. Sitting in the Inter-Continental Hotel, listening to a Muzak version of "I Just Called to Say I Love You," reminds some of the Hotel Caravelle in Saigon, where you could sip a drink on the rooftop, removed the far off thunder of heavy artillery. There are some military installations, some young men in green uniforms carrying Russian AK47s, but it is the absences you notice -- the 18- and 19-year-old men.

"They are sent to the hills to be killed and to kill," said an angry, gesticulating mother in Gatling-gun Spanish, one of thousands distressed at the Sandinista draft.

Harkin and Kerry know that the Sandinistas' revolution has soured. "But in all our talks," said Kerry, "we found no enthusiasm, even among those who are for the contras, for keeping this war going."

As the plane was taking off at the end of their two-day trip, Harkin was asked if he saw a propaganda ploy in the Ortega proposal he was bringing home. "No," said Harkin, who has been to Nicaragua four times. "You have to understand what they've been through. There were always people in the United States talking about overthrowing the government.

"But I don't detect a rigid totalitarianism. They have too many disagreements for that!"

Kerry responded, "I believe Nicaragua understands beyond any doubt the United States will never tolerate a Soviet or Cuban base here. But we've got to create a climate of trust. Look, let's try it! It's better than killing people. Then if it doesn't work there will be a lot of congressmen and senators who will feel betrayed and won't have much hesitation about making a change. I see an enormous haughtiness in the United States trying to tell them what to do. Our economic squeeze on them is very sad. The whole population is suffering."

Harkin and Kerry said the most difficult issue with Ortega was a cease-fire, which Ortega agreed to on condition that the United States provide assurances it would give no aid to the contras.

The White House denounced the offer as a slick "propaganda initiative" to sway congressional votes. Former secretary of state Henry Kissinger suggested that congressmen should not play secretary of state. Kerry, out of the T-shirt and khakis he wore in Nicaragua, back in pin-stripe senatorial uniform, shot back on "Face the Nation" that he and Harkin had no intention of playing secretary of state, but that it was "interesting" that they had talked to Ortega more than has Secretary of State George Shultz.

For yesterday's eight-hour bargaining session, Senate Minority Leader Robert Byrd (D-W.Va.) told Harkin and Kerry that only one of them could be present. "So we flipped a coin, and Kerry, with the luck of the Irish, won," said Harkin.

Harkin was sad and weary at the initial White House rejection. "They just have an ideological fanaticism with respect to Nicaragua that goes beyond any bonds of reasonableness."

Harkin recalled how sincere he felt Ortega had been during the negotiations. At this crucial time, the Sandinista leaders, aware of their negative image, have softened their diplomatic posture, such as Ortega's concessions on ending censorship and the Soviet-Cuban presence if the United States stops aiding the rebels. They also argue that their own deep suspicions and fears are justified; the United States has invaded them three times, they often point out. Ortega was aware that just last week, for the first time U.S. arms were used in Honduran "war game" maneuvers.

Ortega, a man consistently depicted as unsmiling and dour, relaxed at times during their meeting, Harkin said. "We talked about our kids." Visitors to Managua

Kerry, 41, a patrician Bostonian, was a naval officer who also earned a Bronze and a Silver Star. Harkin, 45, the last child in a family of six, son of a coal miner, lied about his age in high school to work summers laying track for a railroad and had a military scholarship to Iowa State in 1958. He now serves on the Senate Appropriations Committee. Harkin seems more at ease with people than Kerry and easily punctuates his sentences with swear words.

Waiting for the plane to pick up more passengers in Belize, Harkin spotted a small plane with "United States of America" emblazoned on its side. "What the hell is that doing here?" he said, and walked up the runway to get the number. "Some goddam general is probably down here scuba diving on taxpayer expense. I'm going to find out about it."

Harkin was a "gung-ho pilot" who "always thought of going into combat. Every fighter pilot's desire was to shoot down a MiG. Early on when there wasn't much antiaircraft, pilots would come back and say, 'Hey, war's great man, nobody shoots back.'

"My job was to test-fly damaged planes once they were fixed." Stationed in the Philippines near Subic Bay, Harkin began hearing different stories as the war went on. "One pilot I knew well suddenly said, 'I'm not going to fly any more bombing missions. I'm dropping bombs on innocent civilians.' They had him off that ship and back to the States the next day.

"That really made an impression. And then a friend of mine from flight training was killed. And then another good friend, Eddie Ferguson. Then I talked to another friend, a real gung-ho type and he said he was getting out. 'To hell with this, I'm killing civilians.' " Harkin's voice takes on a wonderment after all these years. "Like him, I always thought I'd make the Navy my career. I saw the frustration on all sides, including those who said, 'Goddam, if they'd just let us go up and bomb Hanoi, that's what we've got to do.' There wasn't a coward among them, they'd go to their death if they felt it was right, but they felt the senselessness and frustration.

"So I got out. I was just bumming around, met the state Democratic chairman in Iowa and worked for the Democratic Party." Harkin lived an obscure life until he went on a fact-finding trip in Vietnam as a congressional aide. But he was becoming increasingly political "and then the tiger cages -- boy, that really did it."

Harkin returned to tell the harrowing story of South Vietnamese prisoners in pits -- the tiger cages. At least one congressman tried to restrain him from telling the story and releasing his pictures of people huddled like animals, peering through bars dusted with lime that had been dumped down to choke them. Harkin resigned before making the pictures public.

Haunted by the suffering he witnessed, Harkin plans to return to Vietnam this summer to try to find some of the tiger cage prisoners. Like Kerry, he has been denounced during his political campaigns for being "unpatriotic." Enemies of the State

Many Nicaraguan businessmen were anti-Somoza, but they were not ready for the Sandinista aim of redistributing wealth. Romero Gurdian, vice president of a businessmen's organization called COSEP, spoke of economic chaos and repression by the Sandinista government. The senators asked him whether they should vote for the contra aid.

"Put it this way. In 1981 we sent this letter protesting restrictive Sandinista measures and they put us in jail. We were the number one enemy. Since the contras, we have become enemy number two! We are still here talking to you because the contras exist."

Harkin asked what the contras accomplish.

"Pressure," replied Gurdian. "I believe the people of Nicaragua are going to overthrow this government because the economic situation is terrible."

Still, when Harkin asked if the United States should intervene militarily if the contras fail, the answer was a flat, "No."

Another businessman suddenly nodded and said, "What about my kid, what about my grandson? Is it to be the same over and over? No, we don't want Marines here."

They want to try negotiations, but are suspicious of the Sandinistas. "We have to have free elections, freedom of the press."

An inept air conditioner was going full blast in the suffocatingly hot office of Virgilio Godoy, Independent Liberal Party leader. Godoy had been in the government after the revolution but quit to run in last year's election. He then withdrew, saying there was no possibility of a fair vote.

The senators asked Godoy what he thought of atrocities said to be committed by contras.

"It is true. These atrocities occur on both sides." And once again came talk of peace: "I believe this happens because war is cruel. We are opposed to war. In the last three years more than 15,000 Nicaraguans have died in this war. Having been in the government I can assure you they have a desire to build a massive army. I don't think Nicaragua is arming itself to take on Central America but to guarantee the existence of a Marxist regime."

Asked why he stays, Godoy said, "I was in exile for many years under Somoza . I will stay because I believe it is where we can solve the problem and not on the outside, to fight for political freedoms, new elections. I believe the United States could win -- but then with an increase of American aid comes an increase in Soviet aid to match it."

The last question: "Should we vote for aid to the contras?"

Godoy smiled. "That's your problem." The Sandinista View

In the National Assembly, an imposing high-ceilinged building with Art Deco sculptured pillars, a building from Somoza's days, sits National Assembly President Carlos Nun ez. He is 33 and looks younger. Like many of the revolutionaries, he is now struggling with being a politician.

He is impassive when grilled by Kerry about questions that "concern us and others -- freedom of the press, reprisals against the church, freedom of assembly."

Nun ez says they have made mistakes: "Some of our laws were made under great tension and contain restrictions on political parties that will have to be changed. If we weren't at war, why would we need censorship? What sense would there be in having the draft? We wouldn't have to spend so much of our money 40 percent on defense. Standard of living would go up."

Nun ez insists that "Nicaragua wants to maintain a position of nonalliance and independence" -- including independence from Russia and Cuba. "We've never been opposed to economic and diplomatic relationships with the United States."

At a briefing of the Ministry of Defense, Harkin and Kerry are joined by others, including three congressmen. One is Rep. Tommy F. Robinson, a Democrat from Little Rock.

Robinson says he is "going to the war zone tomorrow. I don't care if it takes 10 hours. Now I'm a hawk. If Reagan doesn't have me, he doesn't have anybody, but I have to keep asking myself who are we to be telling them what kind of government they should have? I'm wavering, I tell you."

After he went to the war zone, Robinson was still undecided, having no love for the Sandinistas but also having reservations about the contras and "some of their inhumanitarian acts."

"The Sandinistas are definitely Marxist, young and we're going to have to deal with 'em down the road. I told one of 'em we could whip your butts anytime we wanted to. But I think we need to find a way to negotiate with them. Look, I'm an old boll weevil and I'm forcing myself to listen. But I do not get the impression they will run or give up."

Kerry standing by says, "Do we want to see the body bags coming back again?"

Robinson nods. He was hoping that if compromises could be reached "we might have, as we say in Little Rock, a 'do-able deal.' " Just hours before the vote, Robinson was still undecided.

In such conflicts, people attest to atrocities on both sides. For example, witnesses have come to Washington to testify about Sandinista cruelties. But in this city, Harkin and Kerry hear of contra victims from American religious men and women who have worked with the poor in the war-riddled mountain area.

Abstractions give way to violent realities. They cite accounts of slit throats and gouged eyes. Lisa Fitzgerald spoke of the contras kidnaping and forcing men to fight. "One teacher refused. He was tortured for three weeks and finally gave in and said yes. Then he escaped when the contras came in for attacks." The senators listened quietly as Jim Feltz, a priest in the mountain area said, "More than 100 people died in my parish. Last May they killed 35 in a massacre, including nine women and five children."

Then Don a Zoila Rosa Dominguez, a middle-aged woman, arrives with the picture of her dead daughter, Estrella, in white graduation cap and gown. She never uncrosses her arms to release the picture, nor the yellow dried flowers clutched in her left hand. Next to her is a beautiful 15-year-old, Jilma Montoya.

One of the religious workers translates: Neighbors came and told Jilma that the contras were going to rape her. Estrella, a school teacher, brought Jilma down to Managua for safekeeping. Back in the mountains, on her way to teach, Estrella and four others were killed when the contras ambushed their white pickup.

There is a long silence. The senators stand up, reach out to touch the mother. They ask if there is anything they can do. The translator gives them her reply: "She would thank you for anything you could do that would make this war stop." The Lingering Question

On the plane back, Harkin muses, "Now here is something that is not parallel to Vietnam. And is scary. There is no way we could have 'won' in Vietnam. We could have bombed them off the face of the earth, could have occupied them for maybe 10 years with a huge force, but for what? If genocide is a victory we could have had that victory.

"But from a military standpoint it is possible we could 'win' in Nicaragua. I have a sneaking suspicion some of the Reagan people and some in the Department of Defense really believe a military victory in Nicaragua could be had without paying too high a price. It's much closer than Vietnam. We don't have the logistic problem. It's much smaller. Not that populated and they're concentrated.

"Now it wouldn't be Grenada; you'd lose thousands on both sides, but I do believe you could develop a scenario for military victory. That's the scary point. But here's the parallel with Vietnam. Even if we won, what have we won? It would still be as poor as ever, you'd get some strong man back in and we'd be right back where we were -- and 20 years from now there'd be another revolution."

Kerry is more optimistic. "I don't think Congress would let it happen. I think there is a very strong sensitivity just ingrained in people like me, Harkin and Gore by virtue of the Vietnam experience that sounds alarm bells. I think all across the Hill there is a generational feeling, even with those that didn't go. I don't think it's isolationist. I'm not. I think it's pragmatic and cautious about what we can achieve."

Kerry shakes his head as he takes one last look at Nicaragua from the air.

"Say if Costa Rica were defenseless and there were an attack by Nicaragua, there are treaties where we could come to their defense. But starting something is another matter. One of the great lessons of Vietnam, for God's sake, was 20 years of effort there! Ten years training, 10 years with our own; we created the fourth largest army that didn't want to fight. These are just poor people, no money, no food, just like Vietnam, and they are just trying to stay alive.

"They just want peace. They don't want their daughter getting blown away on the way to teach! Or their sons disappearing. It's just terrible. I see the same sense of great victimization. The little kids staring wide-eyed and scared. It really hits home the same way as Vietnam. Sending our own troops? I just don't think Congress or the people will allow it."

Kerry sighs. "If we haven't learned something by now about talking rather than fighting . . ."