Greece's stamp of approval on continued operation of United States military bases here is expected to go a long way toward smoothing its rocky relations with Washington and Western Europe.
Greek Socialist Prime Minister Andreas Papandreou took office in 1981 pledging to expel the US ''bases of death'' and to withdraw from the North Atlantic Treaty Organization. But the defense agreement initialed late last week allows US use of the bases for at least more five years and ensures that, barring an unforeseen crisis, Greece will remain a NATO member.
In exchange, Greece gets a vague US commitment to maintain the balance of power between Greece and Turkey in the Aegean region and a provision that allows it to halt any use of the bases that would threaten Greek relations with friendly countries - in the Middle East, for example. Greece may also curtail activities of the bases in cases of national emergency.
The defense and economic cooperation agreement is understood to include a US promise to help Greece's infant arms industry by buying arms from it. Papandreou says Greece also will get $500 million in military aid from the US in 1984.
The prime minister has asserted that the US bases would be dismantled within 17 months of the accord's expiration. But sources close to the talks say nothing prevents the two sides from renegotiating the agreement after five years.
For Greece and its Socialist prime minister, the agreement is a watershed. For the United States, it relieves a major irritant in US-Greek relations and removes a serious obstacle to resolving other difficult political and military problems on NATO's southern flank.
According to a US Embassy statement, the agreement ''serves the purpose of continuing good bilateral relations across the board.''
During the last eight months of what a participant called ''tough, frustrating negotiations,'' the base issue dominated Greek political life and even affected business confidence.
''The bases poisoned everything,'' a business leader said, ''because the issue has created so much uncertainty. Now Papandreou has sent us a clear signal that he will not leave the West. This will not fix the sick economy, but it can help relieve fears.''
The agreement was greeted with a sigh of relief from West European diplomats, as it eased suspicions that Papandreou's commitment to the West is only lukewarm. ''This should help Greece during its presidency of the European Community (its six-month term began on July 1) because it will bolster confidence in Papandreou,'' said one. Many feared that failure of the base negotiations would create yet another crisis in NATO at a particularly difficult time.
In recent months Papandreou's opponents on both the right and the left and even some of his supporters have criticized him for indecision and lack of a clear sense of direction. Combined with Greece's increasingly cooperative, though independent, attitude within EC councils, the base agreement should diminish such criticism. Papandreou has for now clearly decided to pursue a moderate, pragmatic course within the West.
But if the base agreement has reassured conservative and centrist Greeks and West European diplomats, it has caused discomfort on the left wing of Papandreou's own party - the Panhellenic Socialist Movement - and angered the relatively small but well-organized and vocal Communist Party.
Only hours after Papandreou announced the accord, the Communists turned out thousands of demonstrators against the bases in the country's major cities.
Many foreign and Greek political observers assert the base agreement will do irreparable damage to the already hostile relationship between Papandreou and the Communist Party, which recently has taken to accusing the prime minister of betraying his mandate and has called for a referendum to approve the new base accord.
With the base agreement behind him, Papandreou will not long be able to avoid closer scrutiny and criticism of his handling of the country's troubled economy.
It remains to be seen whether the prime minister will begin to tone down his flamboyant rhetoric, bringing it more in line with his policies. But many expect him to try to placate the left by making louder anti-American, neutralist noises. Some worry he might use the EC presidency to attack US foreign policies - in Central America and the Middle East, for example.
Whatever Papandreou says for domestic consumption, his words will not likely dampen US satisfaction with the base accord. As a US official said several weeks ago, ''We learned a while back not to be as concerned with what people say as with what they do.''
With the base issue resolved, Western officials hope progress can be made toward Greece's reintegration into the military arm of NATO and toward reopening the dialogue between Athens and Ankara. (Greece withdrew from NATO's military arm in 1974 to protest the Turkish invasion of Cyprus.)