President Anastasio Somoza's beleaguered government suffered a serious diplomatic setback this weekend when five South American nations recognized Sandinista guerrillas as members of a legitimate army eligible for "treatment and prerogatives" as a belligerent under international law.

The statement issued by the foreign ministers of Ecuador, Venezuela, Colombia, Bolivia and Peru, all members of the Andean Pact economic group, essentially rejects Somoza's contention that the rebel forces are "international terrorists" and opens the way for eventual recognition shoudl the guerrillas emerge as probable victors in the Nicaraguan civil war.

Todat one of the pact members, Ecuador, broke relations with Somoza's government. Costa Rica severed diplomatic ties last fall, followed by Mexico last month.

Coinciding with the pact statement yesterday, a 400-strong Sandinista column crossed the Costa Rican border into Nicaragua and joined 300 guerrillas who invaded there Friday.

The joint Sandinista force is the largest yet assembled. National Guard troops defending the southern front reportedly have called for heavy reinforcements and additional air support.

The Sandinista force reportedly is led by Eden Pastora, the guerrilla chief of military operations who staged a successful raid on Managua's National Palace last August after which more than 1,000 hostages were exchanged for jailed Sandinistas.

A Costa Rican radio station quoted Pastora as vowing the rebel column would reach the departmental capital of Rivas within 48 hours. In Rivas 25 miles from the border, the Sandinistas hope to establish a provissional government.

Yesterday, Radio Sandino, the clandestine guerrilla station, accounced the names of a five-member "provisional governmental council." The include Violeta Chamorro, widow of slain publisher and long-time Somoza foe Pedro Jaoquin Chamorro; Alfonso Robelo, a businessman leader of the moderate Broad Opposition Front; Sergio Ramirez, an author and professor who is a ember of the Sandinista-allied group of 12; Moises Hasan Morales, a teachers' union leader who represents the National Patriotice Front, a left-wing alternative to the Broad Front; And Daniel Ortega Saavedra, one of the original Sandinista leaders and a member of the nine-man guerrilla directorate.

The list is notable for its exclusion of the more doctrinaire Marxist Sandinista leaders and the inclusion of Robelo, a U.S.favored left-centrist who has denounced the guerrillas in tha past.

The Sandinistas, by announcing their potenial government, clearly seek to build on the diplomatic initiative provide by such actions as that of the Andean Post Nations.

In Recognizing a "state of belligerency" in Nicaragua, the pact nations recognize the Sandinista-led "popular forces" as diplomatically equal to the government's National Guard. The statement opens the way for possible aid to the opposition government in and attempt to force Somoza into a political solution.

The move also complicates the position of the United States, which has praised previous Andean initiatives in the crisis but has consistenly opposed a Sandinista goverment. The statement calls on "all countries of the continent" to join in facilitating "the installation of a truly representative, democratic regime, justice and liberty in Nicaragua."

Nicaragua has called for an emergency meeting of the Organization of American States, scheduled for Wednesday, to seek action against the Sandinista border crossings. It is uncertain whether the Andean nations can persuade a majority of the 25-nation body - which has rebuffed Nicaragua previously - to support its initiative. Up to now, the OAS has also shown reluctance to sympathize openly with the left-wing revolutionaries and hence has been paralyzed.

It also is uncertain whether the guerrillas can move north to Rivas and manage to hold on to territory they take. Repeated past attempts at a southern stronghold, including an unsuccessful invasion late last month, have been blocked by the National Guard, with guerrilla forces consistently driven back to their camps in Costa Rica.

Reports from the south today indicated the Sandinista force, which the government says is armed with heavy weapons including mortars bazookas and .50 caliber machine guns, have been at least temporarily stopped at Sapoa, barely four miles north of the border.

This time, however, the rebels hope to gain an advantage as continuing battles in Managua and in Nicaragua's northern cities have spread government forces thin.

The government today announced the National Guard evacuation of its garrison in Leon, the second largest city, 54 miles north of here. Although the Sandinistas have controlled the city for more than two weeks, government troops surrounded in the garrision in the city's center had managed to hold the rebels at bay.

Late in the week, the government failed in an attempt to helicopter supplies to the besieged troops and the commanding general, Gonzalo Evertz, reportedly was wounded. A government communique did not detail how the remaining troops were evacuated.

Government rocket and ground force attacks on guerrilla strongholds in Managua barrios continued today, as the toll in civilian lives and property mounted.

The guerrillas now control much of the eastern part of Managua, including the main airport access road. Despite far superior National Guard firepower, the Sandinistas have been aided by strong civiilian support that enables them quickly to reconstruct barricades and easily retreat from National Guard onslaughts.

In western barrios, where heavy fighting took place last week, Sandinista forces have now apparently evacuated to aid rebels in the eastern zone. Civilian bodies littering the streets in the western part of the capital were gathered today by residents and burned in street-corner pyres. CAPTION: Two Faces of War In Managua's Streets: Picture 1, Forces opposing President Anatasio Somoza man barricades in Managua, at left, wearing kerchiefs to ward off tear gaus. UPI; Picture 2, Above, one of an estimated 50,000 homeless from the fighting in the capital stares through steel fence of a crowded refugee center. AP