Poland's Roman Catholic primate today called on the martial-law authorities to free Solidarity leader Lech Walesa and other political prisoners but urged Poles not to take part in antigovernment street demonstrations planned for next week.

Archbishop Jozef Glemp chose celebrations marking the 600th anniversary of the shrine devoted to the painting of the Black Madonna, Poland's most sacred religious icon, to make a strong appeal for a resumption of talks between the Communist government and suspended Solidarity trade union. He was addressing a crowd estimated at 250,000 gathered outside the monastery where the icon is displayed.

Heavy applause lasting more than a minute rippled across the huge meadow in front of the Jasna Gora monastery when Glemp called on the government to "free Lech Walesa" as a necessary condition for securing social peace in Poland. He added that if Walesa were not released, conditions should at least be created so that he could speak "as a free man."

The primate, who is regarded as the spiritual leader of Poland's overwhelmingly Roman Catholic population, also called for the gradual resumption of trade union activity, the release of about 600 Solidarity internees, preparations for an amnesty of people convicted of martial-law offenses and the setting of a firm date for the pope's visit to his native Poland.

An empty chair was set up at the altar for Pope John Paul II, who had planned to attend the celebrations. But martial-law authorities prevented the visit because they evidently feared that a return visit by the pope might trigger another surge of popular euphoria much like the circumstances that gave birth to Solidarity two years ago.

Solidarity has called on its 9.5 million members to take part in mass rallies Tuesday marking the second anniversary of the signing of the Gdansk agreement that recognized free trade unions for the first time in a Communist state. The government has said it will do all it can to prevent the demonstrations.

As the third element in Poland's political equation, the church has been pursuing a two-track policy of its own. The bishops have provided Solidarity internees with moral and material support while at the same time helping the authorities defuse potential unrest.

As a result, the church is regarded by both sides as an indispensable intermediary, and it is the only independent organization allowed to operate under martial law. Glemp is clearly afraid that this position could be jeopardized in the event of a violent confrontation between Solidarity supporters and the security forces and the feared adoption of tougher government policies those clashes might bring.

In his address today, Glemp said Poles should remember the lesson of the Gdansk agreement. He described it as a "victory for common sense" that had been won at a negotiating table -- not on the barricades.

"The streets are not the right place for dialogue," he said. "Enough blood has been spilled already on Polish streets, and that is why we should make the conference table the place for talks."

Underground Solidarity activists have argued in clandestine bulletins that the authorities are not prepared to negotiate unless forced to do so. They have described gradual relaxations of martial law during the past eight months as purely cosmetic.

Many of the pilgrims attending today's ceremonies wore Solidarity pins in their lapels, and a huge cheer went up when a 15-foot banner displaying the union's logo was unveiled on the monastery walls beneath the pope's portrait. The banner read, "Oh Lady of Jasna Gora, take Solidarity under your care."

The celebrations honored the wooden icon, which shows the Madonna and the Christ child and which over the centuries has become a symbol of Polish nationalism. According to tradition, the icon was painted by St. Luke on a tablet manufactured by St. Joseph for the Holy Family. Church authorities now believe it is probably from the 9th century with 13th century overpainting.

At the end of the service, which was attended by several dozen former internees, many members of the crowd flashed the V-for-victory sign, which has become a symbol of support for Solidarity.

Polish television tonight gave fresh details of preparations by the security forces to prevent demonstrations. Pictures were shown of weapons, including a handgun and wire clubs confiscated by the police in Warsaw, which allegedly were intended for use by Solidarity activists in the demonstrations.

The authorities also threatened to suspend production at the giant Warsky Shipyard in Szczecin because of protests over the dismissal of 39 workers who took part in demonstrations last week. The official news agency PAP accused the dismissed workers of planning major disturbances.

Szczecin was one of the centers of negotiations between the government and striking workers two years ago and could be a focal point for fresh unrest next week.