Nearly four years after he commanded the Costa Rica-based "southern front" of the Sandinista revolution against Nicaraguan dictator Anastasio Somoza, guerrilla hero Eden Pastora is back at war in these rugged border hills.

The odyssey of "Commander Zero," once one of the best-known Sandinista revolutionary figures, has come full circle, from a position in the Sandinista government, to disillusionment with its increasing alliance with Cuba, to exile and finally again to the place where he began.

Two weeks ago, 500 to 700 guerrilla troops led by Pastora opened a new "southern front" of battle along the border, this time against the Sandinistas themselves.

Their attacks, although largely limited so far to harassment and minor ambushes, have resulted in new tensions between Nicaragua and a Costa Rican government that no longer wants to be involved in Nicaraguan conflicts, and have threatened to widen U.S. involvement in efforts to oust the Sandinista government.

Pastora's decision to take up arms again follows a recent agreement by his Democratic Revolutionary Alliance exile organization, known as ARDE, to coordinate activities and strategy with a larger force of CIA-backed rebels operating in northern Nicaragua. According to sources close to ARDE who are opposed to the new coordination with the Honduran-based, 7,000-man Nicaraguan Democratic Force (FDN), Pastora also has begun receiving U.S. assistance through FDN supplies.

Pastora had long resisted ties with the FDN on the grounds that anti-U.S. sentiment in Nicaragua, and the fact that the FDN includes many members of Somoza's defeated National Guard, would undermine his credibility as a revolutionary leader and his efforts to spark domestic unrest against the Sandinistas.

But ARDE's codirector Alfonso Robelo said the group had been forced to become more "pragmatic" after acknowledging the failure of its year-long attempt to obtain international support for pressure against the Sandinistas and a peaceful resolution of the Nicaraguan crisis.

"It became a question of our losing credibility," as a viable option inside Nicaragua as the FDN attacks escalated, Robelo said in an interview earlier this month in Washington, where he met with Assistant Secretary of State Thomas O. Enders and FDN leader Adolfo Calero. "Especially for Eden, it was a question of machismo," Robelo said. U.S. officials in Costa Rica declined comment in response to questions on possible aid to ARDE. Pastora himself has been inside southern Nicaragua for the past several weeks, according to ARDE spokesmen in San Jose, and cannot be reached.

One of the reasons that Pastora, a man who always has been eager for press coverage, has been unavailable, Nicaraguan exile sources said, is the opposition of the Costa Rican government to becoming, once again, a base of military operations against Nicaragua. During the fight against Somoza, "all of Costa Rica helped. But the government of Costa Rica doesn't want to play the same role now," said Public Security Minister Angel Edmundo Solano. "We don't like the political situation in Nicaragua, but it's their problem."

The government here believes that involvement in Central America's rapidly expanding war would further weaken its fragile economy and harm Costa Rica's image as a neutral country among Latin American and Western European allies who question U.S. policy in the region.

Although ARDE and other groups have operated freely as political forces with headquarters in the Costa Rican capital, officials there say President Luis Alberto Monge has specifically warned Pastora, Robelo and others against military activity. They note that Pastora has been asked to leave Costa Rica on two occasions when his public statements became too bellicose, most recently last March..

But officials readily acknowledge that Costa Rica, with no army and only a small, poorly equipped Civil Guard, does not have the means to stop his operations, particularly along the remote Nicaraguan border.

At the same time, the officials say, most Costa Ricans have come to dislike the Sandinista government as it has moved leftward and consider Pastora "Nicaragua's greatest hero." Many Costa Ricans, they said, aid Pastora "behind the government's back."

Both support for Pastora and the difficulty of policing Costa Rican territory are readily apparent along the 220-mile border, where at least half the population of the large farms and small villages of the provinces of Guanacaste, Alajuela and Heredia is of Nicaraguan descent. The border area is sparsely populated, running from dry hills in the west through the plains around Los Chiles and into the seemingly impenetrable jungle along the San Juan River to the town of Colorado on the Caribbean coast.

Los Chiles, a village of about 4,000, lies two miles south of the border about midway between the Pacific and the Caribbean. Many of its residents are Nicaraguan, and the nearest town to them is the Nicaraguan village of San Carlos, about five miles away. In between is an area of low vegetation where the only border markings are sporadic stone pillars.

Last month, the Costa Rican government sent about 60 members of the Civil Guard to Los Chiles to supplement a 78-man contingent of the local police force.

Their assignment, a Civil Guard lieutenant said, is to "protect our national sovereignty and the neutrality proclaimed by our president. Our orders are to arrest anybody caught carrying arms."

Before the civil guardsmen arrived, the rural police maintained fixed positions every few miles along the border. Now, those positions have been withdrawn. The rural police stay in the town, and the civil guardsmen send foot patrols into the woods. Soldiers said they regularly listened to battles across the border, most recently a few days ago in the San Juan River town of El Castillo.

The troops complain that they are poorly equipped and undermanned for their task. Armed primarily with aging M1 rifles, they are headquartered in a dirt-floored collection of pup tents and thatched huts surrounded by barbed wire just outside Los Chiles.

According to soldiers here, they have never apprehended a suspect. Nor has any local citizen ever reported suspicions that "counterrevolutionaries" have been operating militarily in the region, said rural police commander Nestor Mora Rodriguez. He noted that Pastora knows northern Costa Rica like the back of his hand, is quite popular in the region and has visited Los Chiles twice this year, most recently during the past four weeks.

A number of soldiers said it is common knowledge that Pastora's forces operate relatively freely.

"Sure," said one. "There are plenty of contras counterrevolutionaries around here." He said they are believed to maintain camps just to the east of here, where "they are supplied by helicopter."

"They launched their first attacks at the beginning of May," Mora said, "when they moved their people in and attacked Sandinista border posts. Look, I don't have many men" to control their activities, he said. "And besides, they hide things much more now" than when Pastora first operated along the border more than four years ago.

During the anti-Somoza struggle, virtually all of northern Costa Rica was turned over to the Sandinista guerrillas by this country's government, with the full approval of most of its people.

Planes carrying arms from Panama, Venezuela and, toward the end of the anti-Somoza effort, directly from Cuba, ran a virtual shuttle service into small unpaved airstrips located primarily in Guanacaste Province on the Pacific Coast. Members of the Costa Rican Civil Guard facilitated the movement of arms and other guerrilla supplies, while Costa Rican hospitals treated Sandinista wounded and sent them back to the front.

It was Pastora who led the Sandinista forces across the border into Nicaragua in some of the civil war's most spectacular battles. By the time he became deputy interior minister in the new Sandinista government, he was perhaps the most popular and well known Nicaraguan in Costa Rica.

When he resigned from the government and left the country in July 1981, Pastora said he still supported the revolution but opposed what the Sandinista leadership had made of it.

Pastora returned to San Jose, where a little over a year ago he issued a declaration calling for an uprising against his former guerrilla comrades. But Pastora and similarly disaffected Nicaraguan politicians and former guerrillas who gathered around him soon decided that the best way to force the Sandinistas to change their ways was through nonviolent diplomatic pressure.

Meanwhile, the United States set about training and supplying in Honduras an anti-Sandinista military force built from the remnants of Somoza's Army and anti-Sandinista Miskito Indian refugees. Pastora denounced them, calling them "worse than the Sandinistas" and said he would even rejoin his former comrades in arms to repel them.

By this spring, however, according to Nicaraguans close to him, Pastora had grown increasingly frustrated by evidence the Honduras-based FDN was ready to pose a real military challenge to the Sandinistas, and by the fact that his efforts to gain international support for the political alternative were failing.

In March, he began a tour of Latin American democracies and Western Europe to ask the support of those political parties and governments who opposed U.S. policy against Nicaragua but believed the Sandinistas had betrayed their promises of democratic pluralism. The trip was cut short after Pastora had been turned down repeatedly because of what the foreigners, according to informed sources, called his inability to present a creditable and comprehensive program for Nicaragua's future.

In Venezuela, sources said, civilian officials refused to see him and made appointments for him with the military general staff. Portuguese Socialist leader Mario Soares rebuffed him, as did Spain's Socialist Prime Minister Felipe Gonzalez.

"The failure triggered a decision by Eden Pastora and Alfonso Robelo to stop trying for political support," said one Nicaraguan exile, "and start armed struggle regardless of the political cost" inside their own country and abroad. "They saw the FDN seizing the initiative and gaining momentum."

The FDN and its CIA backers, who had long wanted the benefit of Pastora's prestige inside Nicaragua and who themselves were under siege in Congress, had the arms and money that Pastora lacked. A series of meetings, in Costa Rica and the United States, cemented the agreement between them last month.

In statements to the press during his recent visit to Washington, Robelo said that ARDE no longer supported congressional efforts to stop U.S. funds and support to the FDN.

"We've been trying to look for a political solution," he said in an interview, "but nobody has been very helpful--the liberals in Washington , the Social Democrats, the Christian Democrats in Latin America or Europe. They talk a lot but do very little."