LUBLIN, POLAND, JUNE 9 -- Pope John Paul II came to this city only 40 miles from the Soviet Union today to declare that the future of Poland demanded revision of the nature of his nation's communist rule.

Earlier, the pope prayed over the ashes of victims of a Nazi concentration camp and celebrated an open-air mass that drew close to 1 million worshipers, despite an intimidating security presence.

The pope spoke diplomatically, but unequivocally, of the communist rule since the end of World War II. "As a son of this homeland," said the former archbishop of Krakow, "I risk expressing the view that it is necessary to think over many questions of social life, structures, organization of labor, all the way to the very premises of the contemporary state organism from the point of view of the future of the young generation on Polish soil."

While John Paul has made numerous comments against Marxism during the nine years of his reign, he had not made such a direct attack on it in his native Poland, nor so near the borders of the Soviet Union that dominates it.

During previous visits as pope, in 1979 and 1983, he was forbidden to carry his pilgrimages so close to the Soviet Union to avoid just such an embarrassment.

Addressing a private audience of academics at Lublin's Catholic University, the only such religious institution in the Eastern Bloc, the pontiff insisted that it was the responsibility of the university to rethink the ideas that shape the future of man and the nation.

The university's "task is to constantly bring up the question of that future in social consciousness," he said. "Bring it up relentlessly, unyieldingly."

The massive show of police force in the streets here put a noticeable damper on what might have been a more ebullient public occasion in this city that for 70 years has been the seat of Catholic education in Poland.

Thousands of truncheon-carrying policemen were trucked into Lublin in recent days to patrol the city as if it were still under martial law, which was lifted in 1983.

Heavily equipped riot police were grouped in city parks, ready to burst forth if necessary. Regular policemen lined the route of every papal procession. Police vans and riot trucks, often by the hundreds, parked at strategic spots around the city.

Official church spokesmen declined to criticize the government's action, in keeping with a climate of detente that seems to have emerged between the church and state since the suppression of the independent Solidarity labor movement.

Less reticent Catholic intellectuals were sharply critical of the security measures. "On previous trips, we had the feeling that any town the pope visited was ours," said Krzystof Sliwinski, the prominent editor of the magazine Znac. "Now we don't feel that way. We feel it is their town."

"Before, when our people were asked to do something {for the papal visit}, they did it," Sliwinski said. "Now, with all the propaganda and police presence, there is a feeling that this time the pope is theirs."

In contrast with a mood of excitement and defiance of the regime during the past visits, the first two days of this trip have been characterized almost by resignation.

A case in point was this afternoon's mass, in a green field on the edge of a workers' apartment development in the suburb of Czuby. While the crowd almost tripled Lublin's population of 350,000 -- testifying to the devotion of hundreds of thousands who drove or walked up to 80 miles to attend -- it was a decidedly restrained turnout.

The pope ordained 46 priests and called on them to make sacrifices in their duty of serving God and mankind. But when he mentioned the slain pro-Solidarity priest Jerzy Popieluszko as an example, there was only a ripple of restrained applause.

Popieluszko, a militant supporter of Solidarity who was inspired by Lech Walesa and other workers from the shipyards of Gdansk, was murdered by three Polish secret police agents in 1984 and has since become a symbol of the Polish opposition to Jaruzelski's communist rule.

Whereas in 1983, when the pope visited Poland in the midst of martial law, his every appearance was greeted with the defiant unfurling of Solidarity banners, this time only a handful have been raised.

Even so, the visit to Lublin had its moving moments, especially when the pope went to what was the Majdanek concentration camp to pray privately over the ashes of some of the 360,000 persons who were gassed to death and incinerated between 1943 and 1944.

With about 700 former inmates looking on from behind the barbed-wire compounds dotted by wooden guard towers, the pope prayed with tears in his eyes and his head held in his hands for 10 minutes. As he stood up, a 75-year-old doctor, Wanda Osowska, a former inmate of Auschwitz and Majdanek, approached him with a bouquet and told him of her experiences before liberation of the camp by the Soviet Army in 1944.

"Let us pray for the dead here in consolation of the faith which tells us that they live in God," the pope said. "You who have survived should remember everything and be a witness for those alive of everything which happened in this camp."

"We must remember those who were the cause of this camp of death as a warning for the world today," he said. "We recommend these {who created the camps} to the justice and mercy of God."