Portugal's governing conservative political coalition faced a serious setback in nationwide municipal elections as computer forecasts early today projected a loss of support of three to six percent to the Socialist opposition.

Despite the projections, based on results from more than half of the 305 municipalities, Social Democratic Prime Minister Francisco Pinto Balsemao made it clear that he would not resign. Balsemao said the losses were not sufficient to put the legitimacy of his coalition government into question.

But both the premier and the leader of his smaller coalition partners, Christian Democrat Defense Minister Diogo Freitas do Amaral, admitted that the weakening of support called for "far-reaching changes" within the alliance.

Top-level party meetings set for later today could result in moves toward a Cabinet reshuffle in an effort to overcome the government's image of inertia and internal quarreling.

If the trend in voting results continued, the Socialists would raise their share of the vote to 30.9 percent from 27.2 percent in the previous ballot in 1979. The ruling coalition's share would drop from 47.2 percent to 44.7 percent, and it would lose control of an overall majority of municipalities.

The voting for 70,000 local government officials was Portugal's first chance to pass a verdict on Balsemao's leadership since he was thrust unexpectedly into power when his popular predecessor, Francisco Sa (cap s) Carneiro, was killed in an air crash two years ago.

Balsemao, now under pressure both from the opposition and dissidents in his own coalition, has acknowledged that a setback in the municipal voting would be a vote of no confidence for his government. Losses at the polls could weaken the prime minister personally and the ministers closest to him within the coalition without triggering a collapse of the alliance as a whole, however.

Social Democratic rebels opposed to Balsemao's conciliatory style are set to use an electoral setback as grounds to oust the prime minister from the leadership and force a Cabinet shake-up in their favor.

The Christian Democrats, Balsemao's right-wing coalition partners, ran separately in many districts in hopes of showing that their support is growing in contrast with the apparent erosion of backing for the Social Democrats.

Early results pointed to a small turnout, which was believed to have hurt the government parties. Heavy rainstorms discouraged voters from going to the polls in the Social Democrats' northern strongholds.

The Socialist and Communist opposition parties have diverted the focus of the campaign from local issues and onto the deepening economic recession, which they blame on the inertia and incompetence of Balsemao's coalition.

Balsemao, a 47-year-old former newspaper editor, has struggled throughout his term to halt the economy's downhill slide. The country is suffering inflation of 24 percent and a $3 billion balance of payments deficit.