SAN SALVADOR, AUG. 17 -- Leftist rebels ambushed a military convoy and fought with troops at dawn today, killing as many as nine soldiers and wounding 21, civilian and military sources said.

It was the most deadly rebel attack in months and came just two days before a meeting in San Salvador of the foreign ministers of the five Central American countries which on Aug. 7 signed a peace plan aimed at ending the civil wars that have plagued the region since the 1970s.

The military press office said six soldiers were killed and 10 wounded.

However, civilian and military sources said at least nine soldiers were killed and 21 wounded when a rebel mine exploded under the first truck of a three-vehicle military convoy a mile from the town of San Isidro in combat-torn Cabanas province, 40 miles east of the capital.

They said heavy fighting followed the ambush before the rebels were driven off.

The two-day meeting of foreign ministers is the first event in fulfillment of the calendar laid out in a peace accord that is to culminatein a regional cease-fire on Nov. 7, 90 days after the presidents of five Central American countries signed the document in Guatemala City.

It is expected to be a difficult session, because many of the stickiest issues in the plan, such as verification measures, were not dealt with directly and left for the ministers' meeting.

The rebel attack also came on the heels of a stepped-up campaign by the guerrillas' urban commandos, who have wounded two and killed at least six members of the government's security forces during the past three days.

Most have been machine-gunned from passing vehicles while on patrol.

The Marxist-led insurgents have been battling the U.S.-backed government for eight years. Human rights organizations estimate about 61,000 people have died in the fighting.

The peace plan signed by the Central American presidents also deals with civil wars in Nicaragua and Guatemala.