The government of President Abol Hassan Bani-Sadr, already boxed in by domestic and international political problems, is taking a beating in a military conflict that may prove a more serious threat: an increasingly damaging war with the country's Kurdish minority.

An indicator of the intensity of the fighting, in which government forces have used air strikes and heavy guns against Kurdish cities and towns, was a six-hour cease-fire called today to allow relief workers to collect the dead from the streets of Sanandaj, the provincial capital of Iranian Kurdistan.

Iranian radio and television reported tonight that the truce was broken when "counterrevolutionaries" opened fire on Army troops and Revolutionary Guards, killing or wounding at least 20 of them.

Before the cease-fire, scores of bodies littered the streets and could not be retrieved because of the intensity of the fighting, reports from Sanandaj said. Kurdish authorities reportedly were worried about the possibility of an epidemic and critical shortage of food and medical supplies.

For Bani-Sadr, the Kurdish war is another instance of his goverment being caught in a conflict from which it does not stand to gain.

As with the problem posed by the U.S. hostage crisis and last month's clashes between leftist students and right-wing Moslem fundamentalists, Bani-Sadr's government has been forced to toe the line drawn by his hard-line Moslem rivals and watch his authority weakened in the process.

Bani-Sadr's declaration of a unilateral government cease-fire last month was met by Kurdish feelers for a negotiated settlement. But the Revolutionary Guards, a fighting force loyal to Iran's leaders, Ayatollah Ruhollah Khomeini, announced that it could not accept a truce and would fight until Kurdish resistance had been crushed.

The developments have forced Bani-Sadr to espouse a tougher position on the fighting in Kurdistan, as evidenced by his statement last night to Khomeini in a briefing on domestic and foreign policy.

According to the official Pars news agency, Bani-Sadr said, "We did not start the fighting in Kurdistan. We tried to persuade them [Kurdish guerrillas] not to begin war and fratricide . . . But they regarded our efforts to prevent fratricide as a sign of our weakness."

In their efforts to wipe out Kurdish guerrilla strongholds, the Revolutionary Guards and regular Army units have resorted to use of F4 fighter bombers, Cobra helicopter gunships and mortars against civilian population centers, causing heavy casualities and material damage. Diplomatic analysts said the use of such weaponry is not only a sign of weak and ineffective armed forces, but also places Bani-Sadr in a political no man's land.

"The government is in terrible shape over Kurdistan," one observer said. "This could even turn out to be Bani-Sadr's Vietnam. I don't think he'll be able to get out of this one."

According to diplomats, a military solution to the conflict looks increasingly remote, and the hard-liners' opposition to negotiation is making it difficult for Bani-Sadr to act to end the warfare.

According to the Kurdistan Democratic Party, one of the main guerrilla organizations involved in the fighting, about 1,500 persons have been killed in Sanandaj in the last two weeks. Most of the casualties have resulted from air strikes and mortar fire, Kurdish sources said.

No complete casualty figures have been announced for the government forces, but several hundred soldiers and Revolutionary Guards were estimated to have been killed or wounded in the fighting.

The Kurdish conflict flared shortly after Iran's February 1979 revolution, when restive Kurds began agitating for regional autonomy from the weak provisional government of then-prime minister Mehdi Bazargan.

After initially rejecting proposals by Iranian generals that the Kurdish agitation be crushed, Khomeini last June ordered a full-scale offensive against Kurdish rebels.

The insurgents were forced to quit their urban strongholds and take to the hills following an onslaught by government forces. But the Kurdish militants gradually worked their way back into effective control of the region as the government became preoccupied with other problems.

Khomeini then reversed himself and tacitly authorized negotiations with the Kurds on their autonomy demands.The negotiations continued through the winter, but fell apart this spring, when Iran moved to back up its war of words with neighboring Iraq over a territorial dispute.

Confronted by skirmishing along the border between Iranian and Iraqi forces early last month, the Tehran government ordered an Army column to march through Sanandaj toward the border area. The column's advance was halted outside the provincial capital by Kurdish groups that suspected the deployment was a ruse to take back control of the city in violation of an agreement to keep Iranian troops out of Kurdish cities.

Fighting between government forces and the Kurds was sparked when hard-line members of small Kurdish parties attacked the column as it was skirting Sanandaj and heading toward the Kurdish town of Saqqez.

The Iranian armed forces replied harshly by throwing helicopter gunships into action against Kurdish urban strongholds.

Last week an Iranian correspondent in Sanandaj wrote: "The situation in the town is intolerable. The town is facing a shortage of food and medical supplies. There is no sign of doctors or medical services. People treat their wounded in the houses without having access to the most elementary first-aid facilities. Hundreds of injured have been hospitalized in houses . . . ."

A weeping Kurdish woman in Sanandaj told another reporter by telephone, "Do something, for God's sake, to end this war."