The European Community's 10 heads of government today welcomed the imminent entry of Spain and Portugal into the community as a political victory for western democracy.

The 10 leaders, meeting only hours after their foreign ministers agreed on the terms of admittance following marathon negotiations, described the community's expansion to 12 countries next January as an event that would strengthen Europe's voice in the world and improve the North-South balance on the continent.

However, Greece's Prime Minister Andreas Papandreou threatened to block the expansion unless his country received compensation for the extra competition its products would face from the Iberian countries.

Papandreou said he was willing to negotiate an aid package based on proposals advanced by the EC's executive commission, which called for more than $3 billion in new loans and grants to bolster Mediterranean economies.

In response to the infusion of such massive aid, Papandreou said he was willing to endorse the acceptance of Spain and Portugal in the community, according to Greek delegation sources.

Britain and West Germany, who would bear the brunt of the financial burden of the extra subsidies, have balked repeatedly at the idea of doling out more money at a time when the community still is plagued by a budgetary crisis.

However, a British spokesman said tonight that the 10 leaders were moving toward a consensus on the amount of Mediterranean aid to be offered and that "it was accepted that Greece should get the lion's share."

Earlier, Papandreou had appeared to adopt a more conciliatory attitude, and delegates from several countries said they believed this was because he realized he had gone as far as possible in extracting more aid without jeopardizing his political relations with fellow socialists, Felipe Gonzalez and Mario Soares, now in power in Spain and Portugal.

The negotiations to bring Spain and Portugal into the community lasted eight years and were stymied consistently by anxieties among the governments of Greece, France and Italy that the influx of cheap fish, fruit, vegetables and wine from the Iberian countries quickly would overwhelm their own fishermen and farmers.

Those concerns ultimately were subordinated to the conviction that the community needed to fulfill its promises of incorporating Spain and Portugal by next year to show faith in their nascent democratic institutions.

Spain is also facing a referendum early next year on its membership in the North Atlantic Treaty Organization. Delegates said that any delay in Spain's admittance to the community could spread disillusionment and strengthen those forces advocating withdrawal from the western military alliance.

West Germany and France also have wanted to inject new dynamism into the community by undertaking wide-ranging reforms designed to promote further economic and political union. But such initiatives have been held hostage in recent years by the long debate over enlargement and a dispute over Britain's contribution to the community budget.

With those conflicts virtually resolved, an attempt is expected to introduce majority voting to replace the current system of unanimity.