A huge crowd of Roman Catholics today greeted Pope John Paul in an area where Poland's Communist authorities once tried to ban churches from a new industrial city.

Visiting the shrine of Mogila Monastery, the pope recalled the long, symbolic struggle with the Communist authorities to build a church at the adjoining steel-mill complex of Nowa Huta.

But the pope was not allowed to visit the church today. The Communist authorities had excluded this stop from his nine-day tour of Poland, which ends Sunday.

It took 10 years to win permission to build a church here, and there were riots in 1960 when police tried to move the cross which stood on the selected site.

It then took another 10 years to build the church, which the pope finally opened in 1977 when he was Archbishop Karol Wojtyla of Krakow. Flaunting a high cross, it stands today where Kral Marx and Great Proletarian avenues meet.

The pontiff contented himself with referring to the Nowa Huta church in a sermon during mass at the nearby Mogila Monastery. Thousands of pilgrims, including many burly steel-workers jammed the abbey's tiny courtyard for the mass and hundreds of thousands of people lined the route to the abbey.

At one point, noticing a statue of Lenin draped in the yellow and white papal colors, the pontiff detached a small Vatican flag from the front of his car and used it as a baton to conduct a chorus after chorus of "Sto Lat," a Polish folk song that translates "May you live 100 years."

"The cross cannot be separated from man's work," the pontiff said later in his sermon. "Christ cannot be separated from Christ's work. This has been confirmed here at Nowa Huta."

The pope said the church had no fear of the industrial world, and recalled how he himself worked as a laborer in the local Zakrzowek quarries during the Nazi occupation.

Inside the monastery chapel, the pope blessed a picture of the Madonna with which thousands of Nowa Huta parishioners had marched in a procession earlier this week. They had hoped that the pope himself would install the picture in their church, but he was unable to do so.

The pope looking fatigued, then told the waiting crowds: "There will now only be a blessing. I am on my last legs." He ate candy to soothe his tired throat.

The pontiff, who has carried out a hectic and grueling program from dawn to midnight over the last eight days then flew by helicopter to Krakow, where cheering crowds greeted him once more.

There were a number of Czechoslovak flags in the crowd. Krakow is only about 40 miles from Czechoslovakia. Some Czechs and Slovaks made their way to the city and chanted "Tomasek, Tomasek," when Czechoslovakia's Cardinal Frantisek Tomasek arrived before mass.

Asked by reporters to comment on reports that many Czechoslovaks had not been allowed to cross the border for the papal visit, Tomasek said, "I'm sorry, that is political." He would not discuss the reports as he walked toward the platform to join the pontiff.

This evening, Pope John Paul visited the military section of Krakow's Rakowicki Cemetery to pray at the tomb of his parents. His father was retired Army Lt. Karol Wojtyla and his mother, Emilia, died giving birth to her third child, a girl, who was stillborn.

The pope's only brother, Edvard, died from scarlet fever during an epidemic in the hospital where he worked as a doctor.

The pope is expected to bless Catholics in St. Peter's Square Sunday night immediately after his return, Vatican sources said. CAPTION: Picture, Despite security, Poles get close to the pope as he rides in an open car. AP