Leftist guerrillas attacked this city 30 miles northeast of San Salvador today and battled in the streets for more than 10 hours with counterattacking government troops before withdrawing into the countryside, which they have long controlled.

The battle between approximately three battalions of leftist rebels and government forces was the largest since June, when the guerrillas attacked the Cerron Grande hydroelectric dam east of here, killing more than 100 government troops.

Despite claims broadcast throughout the day by the rebels' Radio Farabundo Marti that the city had been overrun and the government's counterattacking airborne troops soundly defeated, the guerrillas never succeeded in taking the city center and the police barracks that dominate it.

Even so, there was evidence that at least two government helicopters had been hit and damaged by guerrilla gunfire as they ferried in the elite 800-man Airborne Battalion from the capital's Ilopango air base early this morning.

The rebels' radio had claimed during the day that three helicopters were shot down, four more were hit and damaged and one Air Force A37 jet was hit by rebel fire.

Shortly before sunset this evening, after the guerrilla forces had faded back into the countryside and government forces reestablished control of the city, Col. Jaime Ernesto Flores, the commander of the San Salvador-based First Brigade, denied that any helicopters had been hit.

But the Salvadoran armed forces spokesman, Lt. Col. Ricardo Cienfuegos, confirmed earlier in the day that two helicopter pilots had been wounded and that their craft had made emergency landings on the far bank of the Cerro Grande reservoir north of this whitewashed adobe city, where about 8,000 of its original 40,000 population still live.

Mayor Miguel Antonio Melgar, the owner of the Centro Mercantil shop on the town's central square, confirmed Cienfuegos' report, saying that town residents had seen at least two helicopters hit during the course of the fighting today and that they apparently had gone down "somewhere in the vicinity of Cerron Grande."

Officials put the government's casualties at 20 dead and 25 wounded, but a check at the military hospital indicated that the toll could be much higher.

Flores said that Army intelligence had intercepted guerrilla radio communications indicating that they were retreating with numerous casualties, but he did not have any estimates. Another officer said that government troops had seen no guerrilla casualties in the field and so far had captured no abandoned guerrilla weapons.

Guerrilla radio claims that government A37 jets, which had been seen rocketing and bombing the vicinity all day, had left the city center "in ruins" proved to be highly exaggerated when foreign journalists finally managed to enter the city behind government forces shortly before nightfall.

The quaint, whitewashed central Catholic church, the hospital and the kindergarten, which rebel broadcasts had said were bombed by the government, were found undamaged. Residents of the city denied that government forces had bombed the city during the fighting today, which lasted from 2 a.m. to around noon, when the guerrillas began their withdrawal.

On the town's main street, two adobe residences had been blown up, but residents there said they had been destroyed by rebel rocket or mortar fire because some of the 300-man police and civil defense force that had been defending the town had taken up positions there during the street fighting that raged through the morning.

The picture was not so clear in the outlying city neighborhood of La Cruz, where about 10 houses showed heavy damage. Some residents alleged that those homes had been bombed, while others asserted that they had been damaged by government mortars trying to dislodge rebel troops in the neighborhood.

That the government used aerial bombing around the town was beyond dispute. Throughout the morning, A37 jets and rocket-equipped observation planes were seen repeatedly swooping, diving and bombing in the region by reporters who had been stopped at a bridge across the Sucio River six miles south of Suchitoto.

This evening, when a car driven by The Associated Press's Arthur Allen sought to drive out of Suchitoto down the no-man's-land road that leads back to the capital, he was strafed by a diving A37. Its rockets landed on the road 100 yards in front of his car. As a later convoy of press cars sought to make its way back to San Salvador at dusk, another A37 was firing rockets at unidentified targets just east of the highway.

Flores told reporters that the guerrilla force, estimated at about 700 to 800 men, had left Suchitoto toward the east in two columns and that government forces were pursuing them. Journalists arriving at the town found a large guerrilla patrol astride the highway Flores' troops had used to move into Suchitoto only three miles south of town.

A guerrilla carrying a machine gun who said his name was Lucio said their force had ambushed some of Flores' troops earlier as they came up the road and caused about 10 casualties. Lucio and his comrades seemed relaxed and at ease even though the main government forces were just a few miles away and their spotter planes were circling overhead.

Today's attack came at a time when U.S. military officials and the Salvadoran military had been congratulating themselves for allegedly having wrested the initiative on the battlefield from the rebels since early this year.

U.S. military officials had said the change had come about because of the increasing effectiveness of the Salvadoran armed forces on the ground, their greater helicopter mobility and air support and improved airborne observation of guerrilla movements.