Pope John Paul II today held an unexpected second meeting with Polish leader Gen. Wojciech Jaruzelski here at the end of a day that saw the largest pro-Solidarity demonstration since military rule was imposed 18 months ago.

The meeting in this southern Polish city--which the pope is scheduled to leave Thursday as he departs for Rome--lasted two hours. Polish television said it had been called at the request of the Vatican.

The official Polish press agency described the session as a continuation of talks held by the two leaders in Warsaw on Friday, the day after the pope arrived in Poland, and made only indirect reference to the church-state tensions that have increased during the week-long papal pilgrimage. The Polish statement said:

"The hope was expressed that the visit will contribute to the peaceful and favorable development of social life in Poland and the strengthening of peace in Europe and in the world. It was also recognized that further contact between the Apostolic See and the Polish United Workers' Communist Party will serve the good of the state and the church."

Thousands of Poles outside the archbishop's residence in Krakow spotted the pope at a window after the meeting with Jaruzelski at the Wawel Castle and shouted, "What happened at the castle?" The Associated Press reported. The pope smiled and replied, "You should have been at the castle."

Meanwhile, on a day that saw the biggest crowds of the pope's visit--ranging up to 2 million for an outdoor mass--Lech Walesa, the leader of the outlawed Solidarity trade union, accompanied by his wife Danuta and four children, arrived here tonight for a meeting Thursday with the pope, who reserved his final day in Poland for a private program.

The brief and general wording of the official press agency's report of the meeting between John Paul and Jaruzelski suggested that unresolved problems remain.

To the government's embarrassment, the papal visit has produced huge displays by Poles of sentiment for the banned Solidarity independent trade union movement, keyed to John Paul's rousing endorsements of freedom, truth, human rights and national sovereignty. No communique emerged from their first meeting Friday, which followed speeches by the pope and Jaruzelski indicating a broad divergence in views on how far Poland has emerged from its crisis and on the program it should follow in the future.

In an apparent indication of internal party differences, the ruling Politburo of Poland's Communist Party suspended a regular meeting yesterday pending the end of the papal visit, according to a Polish source.

While avoiding direct public attacks on the pope's performance in Poland, the Warsaw government earlier this week expressed its annoyance with the demonstrations taking place in his presence and called on the church to take firmer action to counteract them. Since then, church officials, including John Paul on occasion, have urged crowds to disperse peacefully after papal masses.

In a communique yesterday, the Vatican criticized "some international mass media" for giving a "political character" to the pope's statements in Poland.

"There is nothing that could run more counter to the intention of his holiness, who, on many occasions, has openly stressed the exclusively religious and moral character of his second pilgrimage to Poland," the statement said.

Summing up his highly charged pilgrimage, John Paul today called on Poles to have faith and hope, and he prayed for a victory for the nation.

As symbols of the victory, the pope, at an outdoor morning mass attended by approximately 2 million people, beatified two church figures who fought in the failed Polish insurrection of 1863 against the Russians and then devoted their lives to church activities. Beatification is the last step before canonization of saints by the Roman Catholic Church.

For many Poles attending or listening to the service--one of only two papal masses broadcast nationwide--the beatification of two men involved in the 19th century uprising was associated with the resistance of Poles today against the Communist government.

The pope praised the two--Father Rafal Kalinowski and Brother Albert Chmielowski--for their service in the attempted revolution, saying they fought for their compatriots out of love and were inspired "by heroic love of the homeland."

But he added that participation in the uprising was only "a stage on the path to holiness." His stress was on what came afterward. For Kalinowski, who joined the Carmelite order, it was teaching. For Chmielowski, who founded the Albertine branch of the Franciscans, it was artistic activity.

Earlier this week, John Paul beatified another Polish figure, Mother Ursula Ledachowska, who was expelled from Russia in 1914 for underground attempts at educating Catholic girls and continued her teaching efforts in Scandinavia and Poland.

Referring to the three in his homily, John Paul said:

"Their elevation to the altars in their homeland is the sign of that strength that is more powerful than any human weakness and more powerful than any situation, even the most difficult, not excluding the arrogant use of power.

"I ask you to call these weaknesses, these sins, these vices, these situations, by name," he went on, "to fight against them constantly--not to allow yourselves to be swallowed up by the wave of immorality and indifference and despondency."

He called on people to "be strong" in faith and hope and, in a stirring conclusion that brought several dozen Solidarity banners waving above the throng gathered in Krakow's central meadow, the pope said: "The nation, too, as a particular community of men and women, is called to victory, with the strength of faith, of hope and of love--with the strength of truth, of freedom and justice."

Addressing Christ, he pleaded: "I beg you for such a victory. I commend to you the difficult 'today and tomorrow' of my country. To you I commend its future!"

The vast audience of pilgrims thrust their hands into the air as the pope finished, making the now-familiar V-for-victory salute amid chants of "Long live the pope." It was as enthusiastic a reception as John Paul has received anywhere on his Polish visit, and particularly heartfelt given the close identification between the people here and the pope who as Karol Wojtyla was archbishop of Krakow for more than a decade.

The pope acknowledged this bond at the start of his homily, calling the city "my Krakow."

As the mass ended and people streamed toward the city center, the holders of Solidarity banners converged into a marching corps of several thousand. Chanting, "Come with us, there's no beating today," and other slogans, the marchers set off toward the industrial suburb of Nowa Huta seven miles away, where the pope was to consecrate a new church.

A police helicopter made several swoops over the demonstrators, appealing to them in unusually polite terms to "go home quietly" and "show cultured behavior." But the crowd whistled back.

The marchers were applauded when they reached Nowa Huta and joined a throng of 300,000 people massed around the church, named for the recently canonized Polish St. Maximilian Kolbe.

That church has a heroic history. A zealous priest named Joseph Kurzeja, with the support of then-archbishop Wojtyla, overcame fines and hardships to win official permission from Poland's Communist authorities to build it.

The priest died of a heart attack in 1976, the year permission was finally granted. The small green shed he erected in 1970 for religious services has been left standing beside the new modernistic structure.

The church is the second to be finished in Nowa Huta, a community built in the 1950s as a model socialist community--meaning one with no churches. Noting the approval that has been given for a number of other new churches to be built in the area, John Paul declared: "They have risen here thanks to your faith and thanks to your Christian solidarity."

Later came a peaceful demonstration, the largest since the imposition of martial law in Poland in December 1981. Shouting, "The pope is with us, we're with the pope," they moved toward the center of Nowa Huta.

At their peak, the demonstrators numbered at least 50,000. The march was led by a group carrying a large Solidarity banner and a papal standard.

Heavy reinforcements of police brought into Nowa Huta made no attempt to interfere as the demonstrators moved toward the first church built in the steel-making town. There, the marchers placed flowers in memory of a student killed in riots in October protesting the banning of Solidarity.

Then, shouting, "We're going to see the pope," and singing the Polish national anthem, they moved off toward Krakow.

After going four miles, the demonstrators were confronted by a convoy of more than 60 police vehicles blocking the road to Krakow, where the pope and Jaruzelski were meeting.

Eventually, the demonstrators were pushed into a field, where a Krakow church official who said he had been sent as a papal emissary persuaded them to disperse.