At the height of the battle for the city of Matagalpa, a Nicaraguan National Guard soldier lay on a blood-soaked cot in a Catholic hospital filled with refugees.

Shot through the eye and obviously dying, the soldier asked for a priest so he could confess. Refugees watching the scene showed not a flicker of sympathy.

"You tell that son of a bitch," one man said to the attending nun, "that there will be no priest until he is ready to confess to killing his own brothers."

Many battles later, the fighting between the National Guard and guerrilla-led insurgents is over, at least temporarily. What remains is a widespread hatred of the government and its soldiers, so intense that more bloodshed can be expected.

The toll from the weeks of fighting will never be accurately assessed. The government has not compiled any figures on civilian dead, most of whom were noncombatants. The Red Cross has estimated 500 dead in Leon, the nation's second largest city, and 400 in Esteli. It is likely that an equal number were quickly buried by fearful friends or relatives before they were counted.

The downtown areas of Matagalpa, Masaya, Leon, Chinandega and Esteli, as well as a number of other smaller towns, are in varying degrees of ruin. Scores of small businessmen and merchants have seen their livelihood reduced to rubble.

In a much broader economic sense, Nicaragua is practically bankrupt, with local economic activity at a shell-shocked standstill and international lenders ill-disposed to advance money to the troubled government.

Military and politically, however, the battle has ended in victory for President Anastasio Somoza. Despite intense pressure that many believe might have toppled other Laun American dictatorships, he remains in office. Somoza has managed further to confuse and intimidate a political opposition that he has dismissed as disorganized and lacking "guts."

Those who did fight him in the streets found their largely makeshift weapons no match for the National Guard. Once the fighting began in earnest, there was little doubt as to its eventual outcome.

In its aftermath, the all sides are assessing where the struggle will go from here.

Key to that question is the Sandinista National Liberation Front, which sparked the war by its Aug. 22 raid on the National Palace in which the guerrillas bartered more than 1,000 hostages for $500,000, the release of 59 jailed compatriots and a flight to Panama.

Somoza has generated some nervousness in such countries as the United States by calling the Sandinistas terrorists and communists, bent on turning Nicaragua into another Cuba.

The Sandinistas, however, have never been terrorists in the mold of the Red Brigades or Baader-Meinhof gang.

Rather, they are revolutionaries in the Cuban sense whose activities have been politically oriented and directed toward Somoza and the National Guard.

At the same time, it is not at all certain, despite their open advocacy of a socialist government, that the Sandinistas have either the will or the power to effect that transition rapidly. They have maintained fairly close contact with the conservative political opposition and say they would participate in a democratic government.

Two things became clear about the Sandinistas over the past month. The first is that they are relatively poorly armed, with little capacity, at least in urban fighting, to pose much of a threat to the National Guard.

While foreign intelligence sources say that some of the M-1 rifles captured from the guerrillas have been traced to those sold by the United States to the government of Costa Rica, Somoza has presented no evidence to support his claims that the Sandinistas have been supplied by Cuba or the Soviet Union. Most of their weapons are U.S. made, and apparently have been bought with scarce funds on the international arms market.

Many analysts believe, however, that following the rebel's recent whipping by the National Guard, the Sandinistas will find a number of sympathetic non-communist governments - perhaps Venezuela and Panama, for example - willing to augment their arsenal.

The second emerging factor is that the Sandinistas are not many in number, although they are up from a total of about 200 a few years ago. The past month has brought the guerrillas innumberable recruits from the urban barricades manned by local high school and college-age Nicaraguans who find the Somoza government intolerable.

According to local sources, most of the guerrillas and the young groups fighting alongside them escaped from the cities into the mountains and over borders into Costa Rica and Honduras.

Next time, the Sandinistas', with their combat experience, may fight not only in the cities, but, Castro-style, in the mountains and forests where they anticipate an advantage over the more cumbersome, U.S. trained military.

Their immediate goal is likely to be what many observers have said was their objective all along - the control of enough land to declare a provisional government and gain recognition from foreign countries.

For the National Guard, the month has been exhausting. While the government has estimated its losses at approximately 40 troops, the casualty rate, by visual evidence alone, must have been much higher.

While few in the 7,500-man force had combat training, the fighting was led by about 700 troops who graduated in the past year from the National Guard Training School run by Somoza's son, Maj. Anastasio Somoza Portcarrera.

What the troops lacked in manpower, they made up in firepower. Cities that were under virtual rebel control stayed in the hands of the insurgents only as long as it took the soldiers to get around to attacking them.

The training school graduates were systematically moved from city to city in convoys, usually taking two or three days to "mop up" an area. After a day or two of bombardment from afar, street patrols who went from door to door looking for suspected rebels found little resistance.

The convoys were made up of an impressive arsenal that included British-made armored personnel carriers, Sherman tanks, U.S.-made troop transports and light observation helicopters equipped with machine guns and rockets, several two-engine, rocket-equipped Cessnas, artillery, and an awesome assortment of automatic weapons.

Nicaragua is believed not to have received any shipments of weapons or ammunition since the fighting began last month, and ammunition supplies are thought to be running low. But the National Guard arsenal apparently has suffered little since the United States cut off military aid two years ago.

Still in the pipeline at that time were at least 5,000 U.S.-made automatic M-16 rifles, received more than a year ago and left crated until the trouble began.

The bulk of recent rearmament has come from Israel, which has shipped at least 500 uzi submachine guns, 500 Galil assault rifles, and four armed patrol boats, as well as ammunition.

Politically, while some opposition politicians are calling the last month's action a victory, others concede it was a defeat. They cite as a misguided early supposition their hope that a split within the National Guard would topple Someza.

"All the political plans depended on its (the army's) division," said one. Except for a minor, almost comical early coup attempt by a splinter group, the Guard remained both loyal and united.

One opposition strategist bemoaned the lack of action in Managua. While other cities in the country of 2.4 million people burned, the capital remained largely tranquil.

The geography of the capital was a factor. Since its downtown was devastated in a 1972 earthquake, Managua has become a series of unconnected business, residential and slum districts. Still, the strategist said, there was a "paralysis of civilian action" in Managua.

"The National Guard could concentrate and regroup itself here with its hands free and its back unguarded," he said.

An opposition strike begun Aug. 25 and designed to last until Somoza's resignation has begun to peter out, and the opposition leadership is expected to call it off Monday rather than suffer the indignity of watching it fail.

While the opposition factions have struggled to unite, and achieved some successes, Somoza's staying power and his ingenious way of simply ignoring them has depressed and exasperated the opposition. The opposition coalition began to crack late last week when the Catholic Church and the business sector issued a separate call for mediation that was accepted by Somoza, who had consistenly ignored such appeals until he was assured of a military victory.

But the key to what has happened, and what will happen, in Nicaragua, is Somoza, who had consistently ignored month, he not only kept close control of the military situation - directing it through his son - but again showed himself to be a brilliant political tactician.

By crying communist, he has confused Western Hemisphere democracies. By treating his political opponents like children, he has frequently reduced them to immaturity. He has shown remarkable persverance in waiting out a business community that wants his departure almost as strongly as it fears its own loss of income.

While he has been laughing at his traditional adversaries, other Nicaraguans - whose politics and economics extend only as far as a day's wages and the next meal - say they have reached the end of patience and pacifism.

While Somoza has blamed the destruction of the cities on rebel bombs and looting, it is the sound of planes overhead and National Guard guns that the people say they remember.

In travelling through Nicaragua's battle-torn cities over the past month, I found only one Nicaraguan who admitted being a "Somocista." The 72-year-old woman, whom Red Cross workers had picked up wandering through the streets during the Matagalpa battle, bemoaned the lack of order in the city, and loudly wondered why "my general doesn't do something about these bandits and their guns."

Another elderly woman in the Indian enclave of Monimbo, outside Masaya, Last week echoed a sentiment heard over and over again. At the base of her adobe house, she showed a two-foot-high concrete foundation behind which she said her family had crouched for two days while Guard patrols roamed the city.

"The only thing we want now," she said, "is guns."