It's the prototype of what used to be called a Central American "banana republic" - a poor. Iowa-sized country with only 23 million people and no inherent economic or strategic importance.

Yet, Nicaragua has been rocketed into world headlines a month-long explosion of internal turmoil and bloodshed that received almost as much attention as the Middle East peace talks going on simultaneously at Camp David.

"Unlike the Middle East situation, most of the world had no real stake in the outcome of the Nicaragua crisis, but people everywhere were unable to turn away from the tragic spectacle of a country in the convulsions of civil war conveyed to them daily through a graphic montage of newspaper accounts and TV film.

By the time the shooting stopped, Nicaragua was a shambles. An estimated 1,500 people had been killed, many of them the alleged victims of atrocities committed by the troops of President Anastasto Somoza; some of the country's principal cities had been reduced to rubble; the commerce and traffic of everyday life had been brought to a standstill, and the populace had been polarized by hatreds that will linger for years.

Of those watching the violence from the outside, probably none felt more helpessness and dismay than the small army of State Department officials who worked around the clock searching for some way to halt the carnage.

It was an effort that brought many of these officials to the brink of physical and mental exhaustion and that is still continuing in a U.S. - initiated effort to bring outside mediation to bear on the conflict between Somoza and his foes.

Yet, judging by the record of what has happened so far, the results of the U.S. effort can only be described as puny. Despite all its agonizing and deploring, the United States was unable to prevent the killing and destruction that tore Nicaragua apart.

In fact, many Carter administration officials say candidly, what happened in Nicaragua amounted almost to a textbook illustration of the limits on Washington's ability to influence events in countries of concern to the United States.

That's a conclusion fraught with bitterly ironic implications. For, in the past, there have been few other places where the United States has used its power more nakedly and decisively to order events to its liking.

It didn't happen that way this time because of what administration officials call "the changing realities" of diplomacy. It was precisely because of the hostilities generated by past instances of U.S. interference in places like Nicaragua that the United States now has swung toward the corrective course embodied in President Carter's pledge to respect the principle of non-intervention, these officials say.

It was determination to respect that pledge, they add, that stood at the core of everything done by the administration during the Nicaraguan crisis. For that reason, the officials say, the mediation effort - an effort that is carefully being carried out under the multinational umbrella of the Organization of American States - represents the outer limits of what the United States can do and still remain faithful to Carter's promise not to intervene in another country'a affairs.

Not everyone accepts that explanation, as has been made clear in recent days by the public statements of such U.S. human-rights organizations as the Washington Office on Latin America and the Council on Hemispheric Affairs and the private protestations of such dmocratic Latin American governments as those in Venezuela and Costa Rica.

To these critics, Somoza is the villain, and they contend the United States could - and should - have done more to restrain him. By taking refuge instead in a nonintervention stance, the critics charge, Washington, in effect, gave Somoza a free hand to brutually put down his opponents and tighten his grip on Nicaragua.

In response to such charges, some administration officials recall the last time the United States faced a situation in Latin America with parallels to the Nicaraguan crisis - the 1965 outbreak of civil war in the Dominican Republic.

At the time, President Lyndon B. Johnson, citing the alleged threat of a communist takeover, responded by sending thousands of U.S. marines and paratroopers storming into Santo Domingo. His action, the officials point out, provoked a firestorm of savage criticism from many of the same individuals and countries now charging the Carter administration with failure to act in Nicaragua.

In fact, they note, the reaction to the intervention in the Dominican Republic helped hone the budding opposition to U.S. involvement in Vietnam. Carter's present reluctance to interfere in other countries, they add, is rooted squarely in memories of the bitter divisions Vietnam involvement created in the United States.

As one administration official says: "Both in his presidency, Carter put great stress on nonintervention because he believes it's a policy that's right, moral and in accord with the wishes of the American people.

"It may limit out short-term freedom of action in some situations, but we will have no credibility if we champion a principle and then abandon it for expediency - even in cases where many people feel we would be doing good by taking the expedient path."

The dilemma to which he refers is illustrated by the Nicaragua situation. By peeling back the layers of history surrounding U.S.-Nicaraguan relations from the early years of the century to the present, it's possible to trace how shifts in American policy have played in big role in creating that country's inner turmoil and in inhibiting U.S. responses to it.

Nicaragua was under almost continual occupation by U.S. marines from 1909 to 1933, and the echoes of that period can be heard quite clearly in the current conflict.

The United States created Nicaragua's military force - the national guard. Upon the departure of the marines, the United States installed Somoza's father as its commander, thereby establishing the dynasty that has seen the Zomoza family control Nicaragua as a personal fiefdom for 45 years.

Similarly, the leftist guerrillas waging armed warfare against Somoza's troops call themselves the Sandinista Liberation Front in pointed homage to Augusto Cesar Sandino, a martyred nationalist who led an insurrection against U.S. occupation during the 1920s.

After occupation ended, Nicaragua evolved into a classic example of a military dictatorship that maintained itself in power by relying heavily on U.S. support.

Somoza, in particular, has catered to past U.S. administrations by echoing a staunch anticommunist line, voting dutifully with the United States in the United Nations and generally swaggering around Central America like a self-appointed proconsul for U.S. interests.

For the Somozas, these efforts paid off handsomely in terms of Washington's long-time willingness to turn a blind eye to the lack of democracy in Nicaragua and to keep the national guard supplied with U.S. arms and training.

That situation began to change abruptly with the arrival of the Carter administration and its emphasis on human rights. In place of the old cozy relationship, Washington substituted a carrot-and-stick attempt to prod Somoza into relaxing his grip by cutting back on military assistance, while rewarding moves toward liberalization with increases in nonmilitary aid.

Some members of Congress sympathetic to Somoza now charge privately that the bloodshed of the past month can be attributed directly to the pressures exerted by Washington. In their view, the administration's tactics only served to fan unrest in Nicaragua and emboldened Somoza's domestic foes to seek his overthrow through violence.

"There's no question that our prodding helped to accelerate the process," replies a State Department official. "But it would be overly simplistic to say that nothing would have happened if we hadn't the status quo in U.S.-Nicaraguan relations."

"There was a pressure-cooker situation building up down there, and the lid had to blow off sooner or later," he contends. "What we were trying to do was head off an explosion by pushing Somoza to ease up and get into a dialogue with his opposition that might have produced a peaceful change."

But the hope that Nicaragua could be moved gradually and peacefully toward democracy was dashed Aug. 23 when a guerrilla group dramatically attacked the national palace in Managua and touched off the unrest that escalated into civil war.

Suddenly, the Carter administration found itself facing a quandary it hadn't anticipated: through the pursuit of its human-rights policy, it had helped to trigger the violence; but it was restrained by the president's nonintervention pledge from taking any direct steps to stop the fighting.

Officials involved in the process admit the administration did nothing during the first couple of weeks of fighting except, as one describes, "stand on the sidelines, issuing statements delporing the violence and griding out option papers."

By mid-September, the icnreasing violence, which at one point threatened to spill over into neighboring Costa Rica, and the reports of atrocities beginning to appear in the press finally convinced the administration it had to shift to some kind of an activist stance.

In groping for a course of action, the officials involved say, consideration was given to taking some overt step against Somoza such as recalling the U.S. military attache or Ambassador Mauricio Solaun from Managua. But, although administration policy-makers privately make no secret of their belief that Somoza should stand aside, the option of trying to force him out was not used.

Again, the dominant bar to making such a move was fear that Washington would be accused of taking sides and meddling in Nicaragua's internal affairs. In addition, the officials add, there was concern that Somoza would dig in and resist the pressure, thereby makin gmediation more difficult.

As a result, the administration decided its only recourse was to seek what the State Department calls a "democratic, mediated solution." But, the officials say, it was made clear at the top of the administration that even such a limited step could be pursued only if it was clothed in the respectability of a multinational under-taking.

That led to a two-pronged strategy. The main effort was concentrated on William Jorden, outgoing ambassador to Panama, who was made a special envoy first to line up other hemispheric countries willing to serve as mediators and then to try and win the agreement of Somoza and his foes to the process.

At the same time, Washington used a special foreign ministers' meeting of the OAS as a vehicle for getting that 25-nation body to adopt a resolution noting Nicaragua's willingness to accept the "friendly cooperation and conciliatory efforts" of outside countries.