In a day of heavy guerrilla activity, leftist rebels attacked a national guard barracks with mortar and machine-gun fire, leaving at least six soldiers dead and 29 people wounded, the army said.

The assault Tuesday on the main barracks of the El Salvador national guard came as rebels of the Farabundo Marti National Liberation Front (FMLN) attacked a prison in Cabanas province and municipal and communications offices in Chalatenango province. No casualties were reported.In another development, the right-wing mayor of Nueva Grenada, a hamlet 55 miles east of San Salvador, was killed late Monday by suspected rebels. The rebels have said they would not permit elected officials to hold office in territory they believe is under their control.

Jose Ulises Hernandez was the sixth mayor to be killed since March 20 when the ultra-rightist National Republican Alliance Party swept municipal and national legislative elections.

The leftist FMLN has been fighting the U.S.-backed government for eight years in a civil war that has left at least 65,000 people dead, most of them civilians.

An armed forces spokesman said at 3:20 p.m. Tuesday a rebel force attacked the national guard compound with mortar, machine-gun and rifle fire. The attack came immediately after a car bomb exploded outside the barracks in eastern San Salvador.

"The attack came from different sides and was backed by mortar," said Col. Leopoldo Hernandez, deputy defense minister.

Hernandez said the base commander, Col. Jose Humberto Gomez, was wounded by shrapnel and was taken to the military hospital, where he was listed in good condition.

The mortar explosions shattered windows and started a fire in a dormitory. Two soldiers died in the burning building and 12 others were wounded, a nurse who survived the attack told United Press International.

"We were able to rescue several agents whose clothes were on fire and their faces were burned," the nurse said. "We pushed them under a faucet, and then we took them to a military hospital."

There was great confusion during the attack, and soldiers had difficulty mounting a counterattack, witnesses and authorities said.

Authorities said six soldiers died, including the two who burned to death. Twenty-nine people were wounded, including four civilians who worked in the compound.

The army sent troops and helicopters in pursuit of the guerrillas, and three rebels were reported killed in ensuing clashes, Hernandez said.