Ayatollah Ruhollah Khomeini is facing his toughest test since coming to power six months ago as he tries to impose his authority in the turbulent mountain region of Iranian Kurdistan.

Having committed his prestige to a hard-line effort to crush a rebellion by Kurdish tribesmen seeking autonomy, Khomeini faces the prospects that a nascent guerrilla war in the rugged Iranian northwest will intensify the strains in his already none-too-reliable armed forces and strengthen political opposition from other sources.

They are prospects that could spell Khomeini's undoing.

Already the Kurdish rebellion has proved to be a source of opposition to Khomeini that is not as easily crushed as the liberal and leftist political groups he banned in Tehran earlier this month and the autonomy-minded Iranian Arabs who were put down -- at least temporarily -- by government forces in Iran's southwestern oil-producing region.

More numerous, better armed and more determined than less cohesive opposition groups, the Kurds are not as susceptible to Khomeini's threats of massive force against them as are other disgruntled parties and minorities. Moreover, the Kurds are capable of waging a damaging and protracted guerrilla war against Khomeini's forces, which rely primarily on Revolutionary Guards from outside the area.

In the latest incidents in the region, Kurdish guerrillas attacked an Army base and at least two more Kurds were reported executed yesterday after summary trials by Islamic revolutionary courts.

The new fighting and executions came as the outlawed Kurdistan Democratic Party, the main rebel organization, rejected a call for surrender from Khomeini, who has declared himself commander in chief of the armed forces in his effort to crush the Kurdish movement.

The latest flare-up scuttled an unofficial cease-fire that took effect after government forces overran the Kurdish town of Saqqez Sunday, ending five days of heavy fighting.

The armed forces and elite Revolutionary Guards under Khomeini's command may be able to continue routing the Kurdish guerrillas from their cities and towns in northwestern Iran, analysts here say, but those troops would likely take a beating in any ensuing clashes in the mountainous terrain that traditionally has served as the Kurds' redoubt.

Renowned as tough mountain warriors, the Kurds might be hard pressed to defend urban areas, but they can raid government outposts and installations in the region almost at will.

That is what happened Tuesday night when, according to the governmment, Kurdish guerrillas hit an Army barracks at the village of Jaldian with artillery, mortars and incendiary bombs and sabotaged the garrison's water and power supplies. Government sources said one Iranian sergeant was killed.

Although they are more vulnerable in urban areas to the government's helicopter gunships, artillery and U.S. supplied F4 Phantom fighter bombers -- used in the battle for Saqqez -- the Kurds seem determined to fight for Mahabad, the main Kurdish stronghold and the capital of a short-lived Kurdish republic after World War II.

"We have decided to defend ourselves and we will fight," a Kurdistan Democratic Party official in Mahabad was quoted by news services as saying. His vow came after Khomeini rejected Kurdish peace proposals and announced tough conditions for ending the conflict, demanding the surrender of the tribesmen and the punishment as traitors of Kurdistan Democratic Party leaders.

Fearing an attack by a column of tanks parked about 20 miles outside Mahabad, Kurdish fighters are holding hill positions commanding the road into the city. The Kurds claim to be equipped with tanks, antiaircraft guns, antitank weapons and some artillery, most of it presumably looted from Iranian Army posts.

Iranian Interior Minister Hashem Sabbaghian said an agreement had been reached to allow Iranian troops into Mahabad but this was denied by Kurdish spokesmen in the city.

Pursuing its apparent policy of controlling cities and towns in the region, the government yesterday warned villages near the scene of the latest Kurdish raid that they would be attacked by air and ground forces if they sheltered rebels.

The official Pars News Agency meanwhile said two Kurds were executed in the town of Zanjan. Islamic firing squads have shot at least 77 persons, most of them alleged rebels, in the Kurdish region in the past two weeks.Kurdish sources told reporters that 57 Kurds were executed in Saqqez Tuesday, but there was no other confirmation of that report.

Although the Kurds have been restive since government authority broke down during the revolution against Shah Mohammed Reza Pahlavi, Khomeini appears to have contributed largely to the current unrest in the Kurdish region. After a Kurdish uprising in the town of Paveh was quelled two weeks ago, Khomeini ordered a full-scale mobilization and dispatched forces to crush an alleged Kurdish rebellion in the Kurdistan provincial capital of Sanandaj, which was quiet. The mobilization, aimed as much at rallying the support of an increasingly disenchanted Iranian public as countering a Kurdish threat, helped to create the rebellion that Khomeini had conjured up.

Part of the trouble also is that the government is skeptical -- perhaps with reason -- of the Kurds' insistence that they are agitating only for regional autonomy, not an independent Kurdish state.