Leftist rebels attacked El Salvador's main hydroelectric complex Friday in the nation's bloodiest battle of the year, with 23 combatants killed and about 36 wounded, the armed forces reported.

The raid came on the eve of a cease-fire announced by the rebels.According to official casualty figures provided by the armed forces press office, 17 soldiers were killed and 16 wounded, against rebel losses of six killed and about 20 wounded.

Guerrillas of the Farabundo Marti National Liberation Front said on clandestine rebel radio they inflicted more than 100 casualties on troops guarding the Cerron Grande dam and generating complex. The insurgents did not report their own losses.

The state-run electric utility CEL said three generators were damaged.

Sabotage of the nation's largest dam, 27 miles northeast of San Salvador, forced El Salvador to ration electricity.

This Central American country, the size of Massachussetts, has a population of nearly 5 million. Leftists have been fighting since 1979 to overthrow U.S.-backed governments. The conflict has killed an estimated 75,000 people.

Rebels announced a halt to offensive action beginning Saturday to cover the period leading up to March 10 elections and to mourn a deceased leftist leader.

The FMLN announced the suspension of attacks and sabotage for March 2-6 in memory of Guillermo Ungo, El Salvador's most prominent socialist politician of the past two decades. Ungo, 59, died Thursday in Mexico City of heart trouble.

The insurgents, in a communique, also announced a unilateral cease-fire for March 9-11. Legislative and municipal elections are set for March 10.

The rebel high command reiterated that it considers the elections illegitimate. It alleges continued repression by the rightist government of President Alfredo Cristiani.

Gen. Rene Emilio Ponce, the Minister of Defense, rejected the guerrilla's announcement of a cease-fire as "propaganda."

Noting that the FMLN said elections would not be held in the northern and eastern zones of the country under guerrilla control, the minister said the armed forces "will fullfill its constitutional duty and go wherever the Central Electoral Council tells us to go to ensure the security of the elections."