The general's who overthrew the government of Prime Minister Suleyman Demirel in Ankara early today did so reluctantly and as a reaction to a disintegrating internal political situation, according to the generals' own explanations and the views of Western diplomats in Europe.

It appears to be a Middle Eastern coup with a difference. The Turkish military has stepped in not to change the country's course radically, but rather to preserve Turkey's ties to the United States and the North Atlantic Treaty Organization and to try to restore some financial health to the nation.

Gen. Kenan Evren's first statements to the nation, and to Turkey's Western allies, stressed that the Army had acted reluctantly and as a last resort to avoid civil war. As portrayed by him, the coup was a virtual carbon copy of the two previous military interventions in the last 20 years.

The Turkish military's intervention was dictated by alarm at the murderous wave of terrorism, both of the extremist left and right, which has left more than 2,000 persons dead since the beginning of the year -- including 220 this month alone -- and out of an impatience with the country's divisive politicians who were clearly fiddling while the nation was burning.

Since the founding of the modern Turkish republic by Kemal Ataturk in 1923, the armed forces have twice intervened against the politicians they felt were leading the nation toward disaster.In both cases -- in 1960 when they unseated prime minister Adnan Menderes and in 1971 when they overthrew Demirel's first government -- the armed forces, as they promised, restored civilian rule in less than 18 months after their takeover.

Western diplomats in Turkey have long maintained that the Turkish generals -- in 1960, in 1971 and still today -- seriously abhor intervening in politics. They consider themselves professional soldiers and believe that their role should be the defense of the nation, not the dictation of its policies.

But when the politicians have failed, as they did in each of these previous crises leading the nation toward economic or political collapse, the generals took upon themselves the responsibility of being the guarantors of unity and national integrity.

In 1960, the armed forces overthrew Menderes, who was later tried and executed along with his leading ministers. They blamed him for failing to deal with an economic crisis that was almost as bad as that facing Turkey today.

In 1971 they overthrew Demirel for the first time, again it was his and the political system's failure to deal with the wave of terrorism among the extremists of the left and the right.

This time the nation is faced both with a disastrous economic situation, despite more than $6 billion in Western loans and debt-servicing relief promised by Turkey's worried NATO allies, and a mushrooming explosion of extremist terrorism that was dangerously approaching outright civil war.

At least six times this year, the Military High Command warned the politicians that they should put aside their traditional squabbling in order to save the nation from ruin. Only two weeks ago, Gen. Evren warned that the continued weakening authority of the state was helping the spread of terrorism.

What the generals wanted was a grand coalition of national salvation, which would have been formed by the country's two leading political parties -- Demirel's Justice Party and former prime minister Buient Ecevit's Republican People's Party.

The generals' increasingly urgent messages -- and veiled threats -- went unheeded. Instead of trying to find a real solution to the problems welling up across the land, Demirel and Ecevit, as well as the extremist splinter groups which surround them, preferred to exchange accusations of blame.

With neither Demirel's or Ecevit's party holding a clear majority in parliament, the two men have exchanged the leadership of the nation over the better part of the last decade through compromising alliances with such splinter parties as Necmettin Erbakan's Moslem revivalist National Salvation Party or the neofascist National Action Party of retired Col. Alparslan Turkes.

Since last spring, the politicians had managed to let their disputes totally paralyze the parliament, with a deadlock over the election of a new president to succeed retired Adm. Fahri Korutuk, whose term expired last April.

More than 100 ballots have been cast with no results, effectively preventing the assembly from taking up any further legislation, including action on the new security measures the armed forces felt were imperative.

Although the armed forces have maintained martial law since 1978 in 20 of Turkey's 67 provinces, they have tried in vain to get the government to put more teeth into the laws against terrorism.

The detention -- or "protective custody" as the military put it delicately today -- of Demirel, Ecevit and at least 100 other members of parliament testifies to the armed forces' anger at the failure of the politicans.

Neither Demirel or Ecevit, however, are expected to face Menderes' fate in 1960, and the junta has promised that all those not guilty of "criminal acts" would be released "at a suitable time."

While the military junta has put the politicians on ice, it is seeking to keep the economic technocrats hard at work, reflecting their own appreciation that the only slightly positive aspects of Demirel's most recent 10-month rule came in the Draconian economic reforms he unleashed on Turkey in January to stave off almost certain bankruptcy.

The importance the junta attaches to maintaining those reforms was underlined by the speed in which they met -- twice during the course of today -- with the reform's architects, Torgut Ozal, director of the state planning organization, and with Hakki Aydinoglu, head of the central bank.

The economic reforms, which seek to revolutionize Turkey's cumbersome, protectionist and subsidized state economy by throwing it open to world market forces and investment, brought a flood of loans and debt rescheduling agreements from international lending agencies and NATO governments. They have given Turkey a brief breathing space to put their economic house in order.

The junta's meeting with the two economic planners was viewed as a measure to assure them, and their backers abroad, that Turkey intends to continue its efforts to stabilize the economy and avoid the slide toward bankruptcy.

Likewise, Turkish ambassadors have been ordered, according to diplomatic sources, to assure their host governments in the West of the junta's intention to maintain continuity in its foreign and economic policies while struggling to curb terrorism at home.

The Turkish armed forces' tradition of being apolitical -- perhaps the only institution in the state still above splintering ideological struggles -- and Gen. Evren's own wide prestige and reputation in the country, are being viewed by diplomats and NATO government officials as the most optimistic signs that the generals will eventually honor their promise to return to the barracks once order is restored.

"The tradition in Turkey, as opposed to most other places, has been for the military to step in only in extreme cases, to redirect the misguided courses of the state," said one European diplomat familiar with the country."We can only hope that this is their intention again and that once internal peace is established, they will again let the civilians have another chance at proving Turkish democracy can indeed work."