Rebels battled government troops in several Nicaraguan cities yesterday in an escalation of the continuing warfare against the government of President Anastasio Somoza.

Reports from Managua, the capital, said leftist guerrillas launched coordinated attacks in Managua and four other cities Saturday night. The fighting continued during the day yesterday and parts of three provincial cities were reported to be in the hands of the rebels.

The latest outbreak of violence was part of a large-scale opposition movement that includes Nicaraguans of all social classes and political tendencies an effort to overthrow Gen. Somoza.

It followed a two-week general strike backed by businessmen and opposition politicians that had brought much of the Central American country to a standstill.

This weekend's attacks came only 10 days after an outbreak of fighting in the provincial town of Matagalpa and less than three weeks after leftist guerrillas seized the main government building, obtaining ransom money and the release of political prisoners.

Somoza, whose family has ruled Nicaragua for more than 44 years, has insisted that he will remain in power until his term ends in 1981.

A Nicaranguan journalist said in a telephone interview yesterday that large parts of the towns of Esteli, Masaya and Chinandega were controlled by rebels. The journalist, who had talked to people in the provinces by telephone, said fighting was also continuing in Leon, Nicaragua's second largest city, about 60 miles northwest of Managua.

There were unconfirmed reports that three blocks were ablaze in Leon and that the guerrillas had besieged the local outpost of the National Guard, Nicaragua's combined armed forces and police.

The Red Cross office in Managua told Associated Press that it had reports from Leon that fire and rescue units were unable to enter the combat area to evacuate the wounded or fight the fires.

A Red Cross spokesman said at least six persons were killed and 25 wounded in fighting in Managua. He said communication with provincial towns was difficult and it was impossible to determine the number of casualities there.

Associated Press reported that Managua was an armed camp with National Guard convoys patrolling the streets and heavily armed troops manning roadblocks at strategic points.

The National Guard said guerrillas attacked five police stations and ambushed buses in the capital Saturday night. Unofficial reports said more than a dozen police stations were attacked and some were set on fire.

The guard said the masked attackers used automatic weapons and pistols, "assassinating innocent persons and causing many injuries, among them women and children."

Government radio and television broadcasts said the armed forces had the situation under control and were conducting a mopping up operation.

The 7,500-man National Guard is practically the only important group in Nicaragua that still backs Somoza. Established after the withdrawal of U.S. Marine occupiers in the early 1930s, it has been trained and equipped by the United States for many years.

Under its human rights policy, the Carter administration has sharply reduced military and economic assistance to Nicaragua.

The State Department has said it views the recent events in Nicaragua with concern, but has publicly taken a "hands off" attitude. Somoza's opponents say Washington's neutral position is helping Somoza, while he says it helps his opponents.