Polish Catholics and Communist officials, as well as church leaders from around the world, joined today in this overwhelmingly Roman Catholic nation in paying a final tribute to Cardinal Stefan Wyszynski, whose stubborn independence over three decades paved the way for the election of a Polish pope and a reform movement unique in Eastern Rueope.

The funeral of the cardinal, who died of cancer Thursday at 79 after leading the Polish church for over 32 years, was the biggest religious service to take place in Poland since the visit here in June 1979 of Pope John Paul II.

An estimated quarter of a million people crammed into Victory Square in the heart of Warsaw to hear him described, in a message from the pope, as "the primate of the millenmium."

The scenes at the funeral resembled those two years ago when the pope, who regarded Wyszynski as his spiritual mentor, returned to Poland on a pilgrimage. The same 40-foot cross was erected in the middle of the square and 37 prelates, led by the Vatican secretary of state, Cardinal Agostino Casaroli, distributed communion at the high altar.

This time, many in the congregation wore badges or armbands of the independent Solidarity trade union formed last year with the cardinal's support. Solidarity's leader, Lech Walesa, and other Solidarity figures were almost lost in the colorful crowd, which included a government delegation led by President Henryk Jablonski, more than a hundred bishops from around the world and scores of Polish miners in their elaborate black uniforms with white plumed hats.

John Paul, in a message written in a hospital in Rome where he is recovering from an assassination attempt, said he had wanted to come to officiate. In ahint that he might come later, he added: "I trust that God will restore my strength and provide and appropriate occasion so that I may do as I feel."

Describing Wyszynski as "the keystone of the Polish church," the pope asked that public mourning over his death be extended from the official four days to the full 30 days prescribed by Catholic liturgy.

"Let these 30 days be in Poland a period of special prayer, peace, concentration, and reflection. . . . May the unforgettable primate and his role in this difficult period of our history be a subject of particular meditation," the pope said.

Wyxzynski's death leaves a gap at the head of the Polish church, to which 90 percent of population belongs. But, in a funeral oration, the acting chairman of the Polish episcopate, Cardinal Franciszek Macharski, made it clear that the church would not waver in its defense of national traditions and its own independence.

Departing from his text, he said the public grief shown for the cardinal had provided an invincible demonstration of "what Poles consider really great, what they consider to be of imperishable value, and what authority they are ready to accept."

Macharski is one of several possible successors as primate. But there has been no indication of when the appointment, which will be made after consultation between Polish bishops and the pope, will be announced.

As dusk fell over Warsaw, the cardinal's coffin was carried -- bobbing up and down on a sea of color -- from the square to its final resting place in the cathedral in the old town. Thousands of mourners following the coffin sang religious and patriotic songs including "We Want God" and "Oh, God Who Protects Poland."

Bells rang out simultaneously in Poland's 9.856 churches as the procession halted in front of the former royal palace rebuilt brick by brick after being destroyed by the Germans in World War II.

The center of the Polish capital had been taken over for the day by the church. As during the pope's visit, the state militia withdrew and order was kept in the vast crowd by church volunteers.Some priests assigned to supervise the crowds sprouted two-way radios from underneath their black and white robes.

Flags flew at half-staff. Surveying the scene in Victory Square, as thousands of mourners clutched elaborately decorated religious and trade union banners, a Polish journalist murmured: "Just what do the Russians imagine they can do with this country now? God help them if they ever come here."

Many Poles regard what they describe as the "experience of self-government" gained from the pope's visit to have been a prerequisite for the upheavals last summer that led to the formation of Solidarity. They say the reform movement would have been virtually inconceivable had it not been for the resolute stand taken by the Polish church under Wyszynski during the years of Stalinist persecution.

The cardinal referred to his battles with the authorities in a last testament that was read on television by the bishop of Warsaw. He said he had always tried to protect the church from the program of "forced atheization" pursued by the Communist authorities.

He said the aim of his service as primate had been to prepare the Polish church for a second millennium. In 1966, at his instigation, nationwide celebrations were held to mark the first 1,000 years of Christianity in Poland.

Apart from President Jablonski, the Communist authorities were represented at the funeral by a member of the Politburo, two deputy premiers and theminister for religious affairs. The party leader, Stanislaw Kania, did not attend but issued a statement praising the cardinal for promoting understanding between church and state.

Kania said Wyxzynski had been able to rise above the attacks leveled on him during more repressive times and put the interests of the nation and state first.

The U.S. delegation was led by Reps. Clement Zablocki (D-Wis.) and William Broomfield (R-Mich.) It included Cardinal John Krol of Philadelphia.