Rebel forces mounted a bloody assault on the Salvadoran Army's main training base here today, killing or wounding more than 100 government soldiers in the strongest guerrilla attack in nearly a year.

Five U.S. advisers assigned to the U.S.-constructed base were present during the predawn attack, but none was killed or wounded, the U.S. Embassy in San Salvador reported. A spokesman said he did not know whether they had fired their weapons or otherwise participated in the fighting.

The Salvadoran base commander, Lt. Col. Joaquin Cerna Flores, said the U.S. soldiers looked to their defense in their small headquarters but did not fire weapons or participate in the two-hour battle to repel the attack. U.S. advisers here usually carry CAR15 automatic rifles, a short-barreled version of the U.S. Army's standard-issue M16.

The assault, in which Cerna said more than 300 rebel commandos took part, marked a sharp departure from the pattern of El Salvador's civil war for the past 18 months, in which rebel forces generally have been held to small-unit ambushes and have avoided confronting the Army directly.

It was the deadliest clash since guerrillas ambushed government soldiers at El Salto, southeast of the capital, last December, killing about 40 troopers, and the most spectacular since an attack on the heavily guarded Cerron Grande dam in June 1984. Perhaps more important, it represented a significant psychological blow to the Salvadoran Army at a time when officers have begun to say they are defeating the guerrillas.

Government officials, for example, have described the kidnaping one month ago of President Jose Napoleon Duarte's daughter as an act of "desperation" by rebel forces no longer able to fight effectively.

"The guerrillas tried to strike a blow that would give them a propaganda coup abroad," said the Salvadoran chief of staff, Gen. Adolfo Blandon, who flew here by helicopter to inspect the damage. "Also, they wanted to raise the morale of their fighters, which has been deteriorating in recent months. But they suffered casualties and did not achieve their objective."

A communique from the Farabundo Marti National Liberation Front, the rebel military alliance, said today's attack marked the fifth anniversary of the front's founding.

"There are more than 200 killed and wounded," said the communique broadcast on the rebels' Radio Venceremos.

Cerna said 10 guerrillas were killed and an unknown number wounded. The bodies of dead rebels, bloodied and blackened, were laid out alongside Army dead in a corrugated metal barracks. The Army suffered 40 killed and 68 wounded, Cerna reported.

A number of soldiers were killed while sleeping in their bunks when rebel attackers threw hand grenades through an open barracks window as the attack began about 1:30 a.m., soldiers said.

Drainage sewers were tinted red with their blood as recruits cleaned up the barracks later today. Mattresses smoldered nearly 12 hours after the attack in the hardest hit barracks on the southern edge of the compound.

One recruit with three months in the Army, Andres Argueto, said he was standing guard on the base perimeter when the rebels attacked. After expending his M16 rifle's single magazine, Argueto said, he was forced to flee for cover.

Cerna said the base, the Salvadoran Armed Forces Military Training Center, held about 1,750 trainees, 250 security troopers and 100 officers and instructors. The number of American advisers varies between six and 12 depending on training cycles, he said.

Col. James Steele, commander of the U.S. Military Group in El Salvador, flew here to inspect the damage and confer with U.S. advisers early this morning. The rebel communique indicated that the U.S. advisers were targets in the attack.

"The Armed Forces Training Center is a vital piece of the puppet Army and is run by a group of North American advisers who on occasion sleep in the base," it said. "We are awaiting confirmation whether our forces succeeded in capturing or wiping out some of our enemies."

U.S. advisers have made the base into the Army's main training facility since Honduras closed down the Regional Military Training Center last year. The base, at this port town on the Gulf of Fonseca in easternmost El Salvador, opened in January 1984 and was expanded when the Honduran facility was put out of operation.

Col. Emilio Ponce, the Army's operations chief who also flew in by helicopter, said guerrilla forces used 90-mm recoilless rifles, 60-mm mortars, rocket-propelled grenades and automatic rifles in the attack. Most damage was done by 90-mm recoilless rifle rounds fired into barracks, officers said. Two of the dozen barracks were severely damaged.

Captured homemade bombs -- paint cans filled with explosives -- indicated that the rebels had intended to blow up more installations.

Ponce and Cerna said the attackers failed to get inside the compound, which is surrounded by two wire fences. But Blandon and a number of soldiers said a small band of the rebels fought their way inside to lob grenades into barracks, including the 10 who were killed. At the same time, they said most of the fighting took place outside the security perimeter.

Soon after the attack was launched, helicopter gunships from the 3rd Brigade in San Miguel, about 20 miles to the west, flew in to offer support, Cerna said. The United States recently supplied the Salvadoran Army with 12 UH1M helicopter gunships equipped with rapid-fire cannons.