Members of Nicaragua's guerrilla-backed "junta of national reconstruction" arrived here this afternoon on a state visit to the first foreign country to recognize them as a legitimate government.

Sergio Ramirez, Violetta Chamorro and Alfonso Robelo were flown here from Costa Rica aboard Panamanian President Aristides Royo's personal jet. Royo greeted them at the airport, along with a military band, honor guard, and thousands of cheering Panamanians.

"The Nicaraguan people have known suffering for 45 years" under the family dynasty now headed by Nicaraguan President Anastasio Somoza,"Royo told the junta members. "You are an exampl to all the countries of the world."

Also aboard the plane was Hugo Spadafora, leader of a brigade of Panamanian volunteers fighting alongside the Sandinista guerrillas in Nicaragua, who was declared dead by Somoza two weeks ago.

Somoza had produced Spadafora's driver's license and government identification card in a press conference and said he had been killed in battle by the Nicaraguan National Guard.

Spadafora's death on Nicaraguan territory, Somoza had said, was proof of Panamanian complicity in an international plot against his government. Spadafora resigned his job as Panamanian vice health minister last fall to organize and lead the 80-man volunteer brigade.

Guerrilla leader Daniel Ortega and Moises Hasan, the other two members of the Sandinista junta, apparently were unable to leave Nicaraguan battle fronts to attend the ceremony here.

Panama's former head of state, Gen. Omar Torrijos, also was noticeably absent, although the junta members drove directly from the airport to his home before holding a late afternoon press conference.

At least six Latin American nations have broken relations with Somoza in recent weeks, but only Panama and the Caribbean nation of Granada have recognized the junta as the legitimate government of Nicaragua.

Throughout their long struggle against Somoza, the Sandinistas have been assisted diplomatically and militarily by Panama. In addition to the volunteer brigade, first Torrijos and now Royo have provided sanctuary for guerrilla refugees and reportedly have supplied and facilitated the shipment of weapons to the Sandinistas.

That assistance nearly cost Panama approval by the U.S. House of Representatives of enabling legislation for the Panama Canal Treaties.

"The people of Nicaragua will never forget the brotherhood Panama is showing them," Chamorro said in a brief speech at the airport.

Chamorro is the widow of newspaper publisher and long-time Somoza opponent Pedro Joaquin Chamorro, who was killed by unkown assailants in Managua in January 1978.

The five members of the junta were named earlier this month by the Sandinista National Liberation Front. They say they will establish a provisional government by the end of this week in one of several Nicaraguan cities, including Leon, Diriamba and Masaya, now held by the Sandinistas.

They have declared their goal to be the creation of a transitional, democratic government to replace Somoza and have pledged early elections.

While the Sandinistas have asked for additional diplomatic support, especially from Venezuela, Colombia, Equador, Peru, Bolivia, Jamaica, and Mexico, those governments have hesitated in according diplomatic recognition to the junta - or in some cases even in breaking relations with Somoza - until the junta has established itself on Nicaraguan territory.

National Guard forces are now concentrated in Managua, the Nicaraguan capital, and in the southern part of the country where hundreds of guerrilla troops crossed from Costa Rica last week. But the Sandinista-occupied cities are still subject to occasional government bombings and artillery attacks.

The United States has shown little interest either in breaking with Somoza or recognizing the junta, which it believes is too heavily weighted to the left. Of the five junta members, only two - Chamorro and left-centrist businessman Robelo - have gained the tacit support of the State Department.

High-level State Department officials, including U.S. Ambassador to Venezuela William Luers, Ambassador William Bowdler, who headed an unsuccessful mediation attempt last fall, and the new U.S. Ambassador to Nicaragua Lawrence Pezzullo, have met here this week.