The center of the biggest city the Salvadoran rebels have ever captured is rubble now.

El Salvador's battle of Berlin ended after five days of fighting with a guerrilla withdrawal and reoccupation by government troops yesterday. Forty civilians and a handful of soldiers are reported to have died in the fighting, burning and bombing.

According to several townspeople, the guerrillas put much of the city center to the torch.

The rebels captured, then released 45 members of the Civil Defense, National Guard and municipal and National Police who were defending the city.

The rest of the 30,000 residents of this mountainside farming city are trying to find a way to start over.

An inexplicably enduring flame this afternoon continued to char a piece of wood among the broken roofing tiles where Beatriz Guadique, one of the town's residents, once had her home.

Refugees found showers that still trickled in the midst of the destruction. Near the columns that once graced the front of the Villas Pharmacy naked children picked their way through empty, broken medicine bottles.

Across the street from the destruction, hundreds of women, each one perhaps representing a family of three to 10 people, were pressed into a long line leading to trucks of emergency supplies from the Salvadoran Red Cross.

Like so many battles in this prolonged war in which neither side is quite capable of winning or losing, the battle of Berlin has left a debilitating sense of despair among the people here.

One store owner who lost most of what he owned in the leveled city center stood looking at the emptiness this afternoon and rattled off the names of people like him who had owned those shops and houses.

"I don't know who's winning," he said, "but I'll tell you what the people really want is peace."

The store owner had escaped with his wife and child from a hiding place in his home nearby and taken refuge on Monday when Red Cross workers were allowed to evacuate everyone from the burning city center.

In Red Cross headquarters, as more than 50 civilians and rescue workers huddled for cover, according to those who were there, fire from one of the government's aircraft hit the building, bringing down the roof that had been covered with a Red Cross banner. By what some Red Cross workers and refugees called "a miracle" no one was injured.

The battle here, part of a guerrilla offensive that continued today with fighting to the east and north, began with skirmishes last Saturday night. Hundreds of insurgents from the People's Revolutionary Army and the Central American Revolutionary Workers' Party--two of the five organizations that make up the guerrilla front--moved down the mountain into the narrow streets overlooking the broad Lempa River valley.

By Sunday morning the fighting was heavy. Today, a carpenter trying to repair some of the damage guided a reporter to a man-sized hole in a wall behind the paramilitary Civil Defense barracks where the rebels, well-experienced in street fighting, avoided doors and simply blew their own opening through the adobe wall to move in on their objective.

The commander of the Civil Defense contigent, a pot-bellied 55-year-old man, was reluctant to talk about what happened. His arm was skinned he said from clammering over rooftops and diving for cover to escape.

He said he hid as a civilian among the population to keep from being captured.

"Even today you find me nervous," said the Civil Defense commander, and advised the reporter to talk to the little boy who acts as a servant in the barracks for the most accurate picture of what happened.

Eleven-year-old Enrique Parilla described the scene with fascinated detachment.

The government defenders fought through the night, then fell back to a wall behind the barracks, then to the prison behind that, then tried to hide in a house near the little city hall, Parilla said.

By 9 a.m. Sunday, those who had not escaped by changing into civilian clothes surrendered, except for a contingent of National Police that held out for almost another day until, according to some reporters who made their way into the town at the time, the guerrillas blasted them out with their rocket propelled grenades.

By Wednesday, despite the government's bombing of what may have been guerrilla strongholds outside the town, the rebels felt confident enough to call a meeting of everyone they could find near the city center and free their prisoners.

United Press International added from San Salvador:

Farabundo Marti National Liberation Front guerrillas routed government defenders in one town north of San Salvador and attacked another today just outside the Morazan provincial capital of San Francisco Gotera, which serves as base for a 6,000-man Army drive.

Military officers said the 20-day government counteroffensive in the northeastern province has failed to drive rebels out of their main bases in the north.

Guerrillas attacked the village of Sociedad, six miles east of the San Francisco Gotera, but failed to take the town's main garrison. Seven soldiers were reported killed.

In Chalatenango province, north of San Salvador, the rebel forces attacked the town of La Reina, killing four Treasury Police defenders and capturing 23 others, journalists returning from the town reported.