Poland's Communist Party leadership was devastated today as a result of the first free election campaign in a Soviet Bloc country.

In a major upset, the emergency Communist Party congress elected only four members of the outgoing Politburo and Secretariat to the new policy-making Central Committee. The survivors included the party leader, Stanislaw Kania; the premier, Gen. Wojcieh Haruzelski, and the propaganda chief, Stefan Olszowski.

One result of the election, which was conducted by secret ballot among the 1,955 delegates at the congress, was to remove both prominent reformers and hard-liners from the leadership. Another was to consolidate the party's centrist faction, which is best represented by Kania.

The new Central Committee -- the party's parliament -- is composed of 91 percent new faces. Of its 200 members, 182 are newcomers, the overwhelming majority of whom have never held a senior position before. By contrast, the turnover at the last elections for the Central Committee in February 1980 was only 32 percent.

Among the leading politicians to lose their posts on the Central Committee are: seven of 11 Politburo members, all five deputy Politburo members, and five of eight Central Committee secretaries. As one Polish journalist remarked with some awe: "It's a massacre."

Of the big names, it was Gen. Jaruzelski who collected the most votes, 1,615, although he still fared less well than two obscure farmers.

Kania was comfortably reelected with 1,335 votes, while one of his principal political allies, Kazimierz Barcikowski, received 1,269.

There was chaos at the press center for foreign journalists when the results were announced. After an afternoon of conflicting rumors, closed-circuit television screens relaying the results from the congress hall were switched on and off. Details of the voting were originally suppressed, but then leaked through semiofficial sources.

The casualties of the election included the Politburo's most prominent hard-liner, Tadeusz Grabski; the deputy premier who negotiated last year's Gdansk agreement with striking workers, Mieczyslaw Jagielski; the head of state for the past decade, President Henryk Jablonski, and the controversial former interior minister, Mieczyslaw Moczar.

The four most powerful regional party chieftains in the country were also voted down: Tadeusz Fiszbach (Gdansk), Stanislaw Kociolek (Warsaw), Andrzej Zabinski (katowice) and Krzystyn Dabrowa (Krakow). Both Fiszbach and Dabrowa are considered leaders of the party's reformist wing, while Zabinski has the reputation of being a hard-liner.

The failure of these politicians to gain places on the Central Committee (although they keep their other jobs) automatically excludes them from running either for the Politburo or for party leader. This in turn helps to considerably whittle down the opposition faced by Kania, who is now expected to be comfortably reelected as first secretary.

The election produced a vote against extremes. Of the controversial figures in the leadership, only Olszowski was returned, and he with only 1,090 votes, just 33 more than he needed. At one point his chances seemed slim, since he was identified with the hard-line faction. But he proved himself an extremely agile politician and managed to convince the majority of delegates to retain him in the interest of preserving the political balance on the Politburo.

The deputy premier responsible for relations with the independent labor union federation Solidarity, Mieczyslaw Radowski, narrowly scraped home with 1,085 votes despite the thunderous applause that greeted a speech yesterday in which he strongly critcized the "hesitancy" of the leadership.

One explanation for the upset is that, under the complicated electoral system, the delegates were really voting against the candidates they dislikes rather than for those they supported. Out of a list of 279 names arranged in alphabetical order, they were asked to delete 79.

One of the losing candidates said the effect of this system was the elimination of candidates who inspire strong feelings and the survival of colorless nonentities. The delegates apparently voted for new men in their own image rather than for the old professionals who, if not themselves responsible for past mistakes, were at least in high political office when the mistakes were made.

Another important factor was regional rivalry. Delegates from major cities such as Katowice and Krakow almost certainly scratched out the names of leaders of rival caucuses.

Asked to comment on the results, the official congress press spokesman, Wieslaw Bek (himself a failed candidate), said the delegates had "shown a lot of common sense" and had been influenced by the new conflicts emerging in the country.

As the delegates were voting, Solidarity chapters representing both dockworkers and airline employes announced they would go ahead with planned strikes the end of next week. The dockers have demanded improved working and living conditions while the airline employes are insisting on their right to appoint a new director.

Solidarity, which was formed after huge strkes last summer, also announced it would hold its own first national congress in two sessions, Sept. 5-6 and Oct. 1-3.

After the first shock of the Central Committee election, many Polish analysts began to see some virtue in the results. Workers and farmers are represented in greater numbers than ever before on the Central Committee, despite their relatively low representation at the congress.

Explaining why he voted for the worker candidates, a delegate said: "They are young, well-educated, but don't owe their loyalty to any particular faction. In general, they're not out to make political careers for themselves and are more responsive to the feelings of their rank and file."

Another analyst said that, with a few exceptions, the election had swept the old professional politicians out of the party apparatus and replaced them with new men untainted by past controversies. Hard-liners were ejected from the Central Committee, but reformers also lost their seats -- so the centrist balance was retained.