Socialist Prime Minister Andreas Papandreou's last-minute refusal yesterday to back conservative President Constantine Karamanlis for another five-year term marks the end of an important phase in Greek politics and perhaps the start of another crisis for Greek democracy.

Papandreou's move, concealed until the last minute, has been seen here as a masterful political coup by his admirers and as a deceitful maneuver by his enemies. It effectively sidelined the only other politician here whose popularity rivals his own.

Karamanlis, 78, did not go gracefully. He resigned tonight, five days before his term expired, and warned of unspecified "possible developments in which I cannot participate."

Nonetheless, the end of a turbulent half-century in politics for Karamanlis fulfilled a 1981 Papandreou campaign pledge to bring about change and clarified the carefully maintained muddle of the Greek political landscape.

Karamanlis, who first entered parliament in 1935 and the Cabinet in 1946, was prime minister from 1955 to 1963, when he was defeated and left Greece for 11 years of self-exile. He returned in 1974, after the fall of military rule, and founded the New Democracy Party, which won the 1977 parliamentary election but lost to Papandreou's party, Pasok, four years later. In the meantime, Karamanlis had been elected president in 1980.

No longer can moderate and conservative Greeks -- or the United States and Greece's other western allies -- take comfort in what they saw as the restraining influence and moral authority of Karamanlis' presidential prestige and power when they have serious second thoughts about Papandreou's often radical words and actions.

Many Greeks also are worried about what they perceive as the country's dangerous isolation now that Karamanlis is leaving the political scene.

Rightly or wrongly, he was regarded as Greece's anchor to the windward, its guarantee that the United States would stand by Athens in times of crisis, that the traditional bugbear Turkey would be kept at bay, and that Greece would not leave the North Atlantic Treaty Organization, as Papandreou has proposed, or the European Community.

A State Department spokesman declined to comment on Papandreou's weekend move, saying, "This is an internal Greek affair." White House deputy press secretary Robert Sims said officials there "haven't had a chance to review the matter" and therefore he had no comment.

Now concerned Greeks recall the chaotic collapse of the widely hated military rule in 1974, when Turkey invaded Cyprus and the Nixon administration, in its final days, did nothing to stop it.

One retired diplomat said, "The Turks are patient and always make their moves when we are weak and divided."

Papandreou appears to feel now that his "forces of change" are strong enough to sweep away the old order and claim unambiguous power for his followers, including a strata of Greek society previously without power, even at the cost involved in accepting Communist support.

His clear dependence on the Communists to elect his hand-picked presidential candidate, Supreme Court Judge Christos Sartzetakis, in the election in parliament beginning Friday, also supposes wider cooperation between the two left-wing parties in the future.

The pro-Moscow Communist Party, which won 11 percent of the last parliamentary vote and 13 of 300 seats in the Chamber of Deputies, has long demanded a real share of power in government. The Communists now appear positioned to exact that price from the prime minister who has refused them in the past.

French President Francois Mitterrand, Papandreou's friend and fellow Socialist, incorporated four Communist ministers into his first government in 1981, at the height of his political power, with the result that he then reduced their party to its poorest election showing in two generations. Papandreou, however, apparently is moving toward an alliance with the Communists as his own popularity erodes and he risks giving Greek Communists their biggest political opening ever.

If the presidential election is a relatively simple matter of adding 13 Communists to Papandreou's 165 Socialists plus a few independents to achieve the required 181 votes, by implication the prime minister also will need Communist support in this year's parliamentary elections, due by October.

Friends and foes of Papandreou say he is capable of wooing just enough Communists into voting for Pasok, the Pan Hellenic Socialist Movement, to provide him with a renewed parliamentary majority, then jettisoning them.

The biggest conundrum of political arithmetic concerns the centrists, whose votes traditionally decide most Greek elections. In 1981, they provided Pasok with an estimated 10 percent of its votes and ensured a clear-cut parliamentary majority for Papandreou. With 48 percent of the vote that year, Pasok won 172 parliamentary seats. Karamanlis' New Democracy Party got 35 percent of the votes and won 115 seats.

But will the centrists be frightened by Pasok's de facto alliance with the Communists and vote for the still largely disorganized opposition New Democracy?

Many thoughtful Greeks know that despite his nationalist rhetoric directed against Washington, Papandreou has proved a full, if sometimes maddening, partner in Europe, has renewed the lease of U.S. bases until 1988 and is renegotiating in apparent good faith the renewal of a civilian aviation agreement and modernization of a Voice of America transmitter.

But they also know that important voices within the administration had expressed increasing exasperation with Papandreou's anti-American and perceived pro-Soviet rhetoric, even before he dropped Karamanlis.