After three months of intensified fighting, El Salvador's leftist rebels maintain a strong grip on a dozen towns and villages that the U.S.-advised Army has relinquished.

Control of the towns in three hilly regions has boosted the guerrillas' prestige among the peasants and given the rebels a rear area from which they can move easily into government-controlled territory for sabotage strikes.

"The guerrillas have made real territorial gains" during a three-month-old offensive, said a U.S. official who monitors the three-year-old civil war. "You have to say their offensive has been a success."

This success and the rebels' continuing attacks aimed at weakening the already limping economy appear to have reversed what the Reagan administration had portrayed as a decline in guerrilla fortunes since an emergency dose of U.S. aid for the Army this year and the rebels' failure to disrupt last M rch's election.

Rebel forces have obtained particular advantage from the Salvadoran Army's preference for large-scale sweeps, followed by periods of inactivity, rather than consistent small-unit patrols advocated by about 50 U.S. military advisers posted in El Salvador, a military expert said.

The reason for his assessment became apparent at a blown-out bridge over the Tamulasco River less than two miles east of here. Soldiers from the brigade garrisoned here patrol as far as where the bridge used to be but no farther, one youthful trooper acknowledged.

"Beyond here, it is subversive territory," he said matter of factly.

Guerrilla strength traditionally has been high in the Chalatenango province hills near the Honduran border. As the offensive began Oct. 10, rebel forces occupied a string of little towns northwest of here, sending several Army outposts fleeing and establishing a regular, open presence they previously had not enjoyed.

In late November -- more than a month later -- Defense Minister Jose Guillermo Garcia launched a 5,000-man counteroffensive backed by bombing from U.S.-supplied A37 Dragonfly combat planes and coordinated with a simultaneous sweep by U.S.-advised Honduran forces on the other side of the border.

In the 10-day effort, the Defense Ministry announced, Salvadoran soldiers recaptured the towns of Las Vueltas, El Jicaro, Nueva Trinidad and San Jose las Flores, claiming 232 guerrillas killed while losing only nine soldiers killed and 20 wounded. Garcia publicly pledged that the retaken towns would get protection against any renewed guerrilla pressure.

But before 10 days went by, Army troops withdrew to their garrisons and the guerrillas quietly resumed control over the towns and surrounding hills. As things stood last week, Army troops rarely venture beyond the Tamulasco River to the northeast or the village of Comalapa to the northwest, in effect recognizing the area beyond as rebel territory.

"You can go ahead if you want to, but take care, because the muchachos boys are there," a soldier told a visitor to Comalapa, using a popular nickname for the rebels.

Three miles up the road, in La Laguna, a woman selling soft drinks in the village square said the muchachos indeed come to town openly once a week to buy supplies. There is no trouble, she added, smiling, because the Army has not been around much since the big counteroffensive.

A confidential Salvadoran Army report made available to The Associated Press suggests the ministry's guerrilla casualty count also may have been inflated. In fact, the report said, the guerrillas suffered only 65 killed and 34 captured during the counteroffensive, while the Army lost 10 killed and 115 wounded.

At about the same time that the Chalatenango counteroffensive was winding down, other units from the guerrillas' 4,000-strong Farabundo Marti National Liberation Front took over several towns in La Union province on El Salvador's eastern edge.

In response, Garcia on Dec. 4 organized another 2,500-man counteroffensive. As part of the operation, troops from the Atlacatl rapid intervention battalion trained by U.S. advisers were airlifted to Sociedad in nearby Morazan Province, then assigned to march swiftly north to Corinto. Another force, in what amounted to a pincer movement, headed up the road from Santa Rosa de Lima toward Anamaros, Lislique and Nueva Esparta in an assault again backed by Dragonfly planes and heavy artillery.

In the background of the large assault was a complaint from retired major Roberto d'Aubuisson, head of the Salvadoran constituent assembly and the country's paramount rightist leader, that Garcia was failing to strike hard enough at the guerrillas.

D'Aubuisson, who has a following in the armed forces, had called for an all-out effort to finish them off. Garcia replied--two days before the La Union offensive -- that he was about to take "decisive" action.

The guerrilla forces, however, were not eager for such a confrontation. Following classic guerrilla tactics, they pulled back while Army troops swept into the disputed towns after only a few encounters. Now, three weeks later, the Army has moved back out and, according to a Salvadoran officer, the guerrillas are back in place across roughly the same swath of northern La Union Province without interference from Army patrols.

Guerrilla movement in and out of La Union was facilitated by bases in the northern territory of neighboring Morazan province, a diplomatic observer pointed out. Rebels have held half a dozen northern Morazan towns since the October offensive began and, according to the guerrillas' Radio Venceremos, have organized the remaining population into a makeshift local government under "people's committees."

Garcia, following a line from U.S. advisers here, has contended that the remote Chalatenango, Morazan and La Union pockets are not worth taking and holding permanently because the guerrillas' main objective is to cripple the economy, whose wealth and nerve centers lie elsewhere.

For that reason, the 20,000-man Salvadoran Army is spread throughout the country, while the five-group guerrilla alliance is concentrated with about 1,500 in Chalatenango and 1,500 in Morazan and La Union. Most of the rest make up sabotage units in the rich Usulutan and San Vicente farming provinces, where they collect war taxes from cotton growers, or camp on the slopes of the Guazapa Volcano 20 miles north of the capital, according to Salvadoran Army intelligence.

To strike at the guerrillas on Guazapa, Garcia last week sent up the 1,200-man Ramon Belloso brigade, trained at Ft. Bragg, N.C. A Defense Ministry announcement said the three-day drive killed 32 guerrillas and captured seven, with the loss of one soldier killed and two wounded.

Guerrilla Commander Benjamin Landaverde said over Radio Venceremos that the effort was "a propaganda campaign," claiming the Army troops moved to within 500 yards of guerrilla positions on the mountainside "and then pulled back on the fourth day."