Turkey's ruling Justice Party suffered a major setback in nationwide municipal elections yesterday and dissident deputies were reported bolting ranks in a move that could bring down the government.

Opposition leader Bulent Ecevit said today that the outcome of the election - in which the justice Party retained control of only 13 of the country's 67 city halls - demonstrated that the Turkish people wanted a change of government. The leader of the leftist Republican People's Party, which captured 43 majorships, said Prime Minister Suleiman Demirel should resign.

Demirel, whose conservative Justice Party has ruled Turkey either alone or in coalition with other rightist parties of nine of the last 12 years, said he would not step down as a result of the vote. "The government still has power to keep it standing," he told reporters.

There was evidence, however, that Demirel's backing was crumbling. Turkey's state-run radio and television reported that three deputies had resigned from the Justice Party. A fourth told reporters he would resign if the other three had done so, but the three could not be reached for confirmation.

The resignations, if true, would wipe out the Demirel government's four-seat majority in the National Assembly and cause a government crisis.

"In a few days' time the Republican People's Party will be able to come to power on its own." Ecevit said today. This was not the first time that Ecevit, social democrat who ordered the Turkish invasion of Cyprus in 1974, has made this claim. He said the same thing after general elections in June, when his party won 214 of the 450 National Assembly seats but lasted only one moth in power as a minority government.

Although yesterday's election result is the latest in a long series of setbacks for Demirel, he is Turkey's most resiliant politican and can be expected to fight a last-ditch stand for power, especially since he could face corruption charges if ousted.

Toppled by the army, in 1971, the balding, moonfaced pro-American bounced back to power four years later. Despite his party's election reverals, he managed to patch together a coalition government again this year after Ecevit's abortive attempt at minority rule.

Demirel's stewardship, however, has brought the country to the verge of economic ruin. Prices of most goods and services have doubled in the past three months and the country's foreign exchange reserves have almost disappeared, bringing raw material imports nearly to a halt and disrupting industrial production.

The Internation Monetary fund has promised assistance but only if Turkey abandons grandiose plans for industrialization that have dragged the country into debt. Demirel, however, cannot get the agreement of his major coalition partner - the slaunchly Moslem National Salvation Party - which strongly favors industrialization.

Similarly. Demirel cannot rein in the neo-fascist National Action Party, which isheld responsible for most of the political violence in Turkey, because he also needs its support. Fifteen persons died in violence linked to the latest election, including three women gunned down at a village voting box in central Anatolia.

Most Turks would welcome by a single party that is able to make decisions aimed at ending the country's economic and political crisis.

This could also be a plus in foreign affairs. The hard-line attitude* of the National Salvation Party has been blocking progress toward settlement of the Cyprus crisis, which has soured Turkey's relations with the United States and Greece and weakened the southeastern flank to NATIO.

The armed forces, suffering from the U.S. congressional arms embargo imposed following the Cyprus invastion, would welcome a return to political stability and a solution to the Cyprus problem.

Despite repeated rumors of army intervention, the generals apear willing for the time being to let things work themselves out democratically.