In 1931, U.S. troops sent to restore order in this country reported that they faced a problem in their campaign against guerrilla chieftain Augusto Cesar Sandino - to clear Sandino supporters from the town of Jinotega, they might have to aliminate most of its population.

The same problem now confronts Nicaraguan President Anastasio Somoza, who seems willing to destroy virtually every city and town in the country to wipe out Sandino's legacy, the Sandinista National Liberation Front.

There are other similarities between that long-ago guerrilla war and the current Nicaraguan conflict. Both the United States and the Nicaraguan government initially dismissed Sandino's guerrillas - and 30 years later their Sandinista namesakes - as irritating but insignificant bands of bandits.

While Sandino in his time - like the Sandinistas today - claimed to carry the banner of nationalism and self-determination, the communist label is pinned on both.

One difference of course is that Sandino's fight was long before Fidel Castro's triumphant descent from the Cuban mountains made nationalist and Marxist revolutions synonymous to much of the fearful Western Hemisphere.

There may be another difference - Sandino lost his war. Three weeks into their latest, and to date largest offensive, the Sandinistas are holding their own militarily against Somoza's U.S.-trained National Guard and rapidly gaining international diplomatic support. There is little doubt they have the backing of the vast majority of the Nicaraguan people, and there now seems a better than even chance that Somoza will go.

Although the Sandinistas have flourished while other Latin American revolutionary movements have failed so dismally, the struggle has been a long one and the reasons have as much to do with Somoza and the rest of today's world as with the guerrillas themselves.

At the time of the movement's official birth in 1962, from the melding of several small guerrilla bands inspired by the Cuban experience, the Sandinistas posed little threat to Nicaraguan stability.

That stability had been ensured since 1933, when Gen. Anastasio Somoza Garcia, father of the current president, was installed as head of the Nicaraguan National Guard, the powerful military force trained and left behind by departing U.S. troops. One of the elder Somoza's first acts was to call for a truce with Sandino, who had fought a guerrilla war against the U.S. occupation since the mid-1920s.

As the guerrilla chief left a reconciliation dinner with the general one night in early 1934, however, Somoza had him assassinated. For many Nicaraguans, as well as many other Latin Americans, that assassination ensured Sandino's place as a martyr in the eyes of the opponents of U.S. intervention, Somoza and the National Guard.

By 1937, Somoza Garcia had installed himself as president of Nicaragua. During the following decades, control of what became a family dynasty was passed first to his eldest child Luis, and then to his second son, current President Anastasio Somoza Debayle.

There were few challenges to Somoza control. Throughout the 1960s and early 1970s the small guerrilla band that took the name of Sandino was but a minor annoyance.

Under the leadership of founder Carlos Fonseca Amador, a Nicaraguan who trained in Cuba during Castro's early years, the Sandinistas lived and fought primarily in Nicaragua's mountainous rural area. Their strategy was that of Che Guevara - who eventually lost his own life in Bolivia trying to expand guerrilla war from rural strongholds to the urban population.

Few Nicaraguans knew much about the Sandinistas, and fewer still had any contact with them. Their occasional attempts to come down from the mountains and spread revolutionary doctrine met with little success.

At the same time, although the guerrillas periodically sought direct confrontation with the National Guard in attacks on military posts, they were no match for the U.S.-armed government troops.

Some of the guerrillas traveled to Cuba for training. Others went to Algeria for lessons in guerrilla tactics from the Palestine Liberation Organization. Still, little progress was made in bringing revolution to Nicaragua let alone in achieving their principal objective, the overthrow of Somoza.

By 1974, some of the Sandinista leaders had begun to rethink their strategy. In December of that year, they brazenly seized the home of a wealthy Nicaraguan during a Christmas party. After three days of negotiations, during which Somoza threatened to blow up the house despite the presence inside of a number of his relatives, the Sandinastas exchanged their hostages for 12 imprisoned comrades and flew to Cuba.

Yet, while the attack caught the brief attention of the rest of the world, it contributed to the partial disintegration of the Sandinista organization. While many of the Sandinistas in Cuba reaffirmed their commitment to Guevara-style rural fighting, others back in Nicaragua decided the struggle was to be won through political reeducation of the population to the point where it would rise up en masse.

While both followed essentially Marxist political lines, the tactical differences between the two groups led to their division into the Prolonged Popular War faction - the traditional guerrilla fighters - and the Proletarian Tendencies.

In 1976, a third faction, the Insurrectionalists, emerged. They believed the movement had become isolated by doctrine and hobbled by concentration on the short-term goal of ousting Somoza rather than on the long-term struggle for a socialist society. Many of those Sandinistas who had come from the ranks of the middle and upper classes began to renew their contacts with the Nicaraguan bourgeoisie. Many segments of Nicaragua, they decided, were opposed to Somoza. The struggle would go much more quickly if the others were brought into it.

Nicaragua's business sector and upper and middle classes at that time were ripe for picking. Long content to share the country's profits with Somoza's own substantial business empire, they were angered when Somoza used international aid sent for a devastating earthquake in 1972 to expand his holdings.

The Insurrectionalists' bid for support from political moderates and businessmen was helped by the fact that the Sandinistas had never been known for the terrorist and kidnaping tactics favored by other Latin guerrilla groups such as the Montoneros in Argentina.

The Sandinista objective had always been first to get rid of Somoza. The rest of Nicaragua, once its attention was caught, could understand this goal.

In October 1977, shortly after Somoza coincidentally announced that the guerrilla movement was dead, the Insurrectionalists staged simultaneous attacks on Guard posts in three towns. The raids marked the beginning of all-out war against Somoza.

The following January, publisher Pedro Joaquin Chamorro, a symbol of moderate political opposition to Somoza, was murdered. Although the crime was never solved, popular opinion held Somoza morally responsible.

Protest demonstrations and strikes began, and the struggle was expanded. In February 1978, the Indian slum of Monimbo, on the edge of the city of Masaya, erupted into the first popular insurrection against the Somoza government.

As the Sandinistas, primarily the Insurrectionalist faction, continued hitting at the Guard, they became the vanguard of expression for long repressed anti-Somoza feeling in other segments of the population. When they staged a spectacular raid on Managua's National Palace last August, taking more than 1,000 government hostages and exchanging them for jailed Sandinistas and $500,000, Nicaragua, except for Somoza and the National Guard, was essentially theirs.

Aside from charging he was the target of a communist plot, there was little Somoza could do. Pressure from the Carter administration on the issue of human rights had limited his methods of retaliation. The Sandinistas began to receive support and aid from other government - including Venezuela and Panama - who found the Nicaraguan dictator an embarrassment.

Although they lost an initial round of civil war last September, the retreating Sandinistas took with them thousands of youthful recruits who saw a revolution as the way to break from the political repression under which their fathers had lived.

Following the September battle, the Sandinistas trained the new soldiers, built up their arsenal and cultivated their new friends among prominent Nicaraguans and foreign governments. Many who feared that the Sandinistas represented radical change - including the United States and anti-Somoza political moderates who tried last fall to negotiate a solution that would exclude the guerrillas - were left behind.

Last March, the three bickering Sandinista factions signed a unity pact. They declared their solidarity with all groups seeking Somoza's overthrow and their dedication to a representative elected government. The final phase of the revolution, they announced, was about to begin.

NEXT: How the revolution grew CAPTION: Picture 1, A Managuan woman, carrying a white flag attached to a branch, returns home from shopping; Picture 2, another woman begs soldiers to let her enter her home. UPI; Map, Managua, By Bethann Thornburgh