APARECIDA, Brazil — Inside, there was nothing massive about the Mass: Just 1,000 people were spaced carefully across the pews of a vast basilica that normally holds 35,000 as the Catholic Church tried to protect parishioners from the COVID-19 pandemic.

Yet such caution wasn’t apparent outside the doors. Thousands of people found themselves unable to stay away from Aparecida on one of the most important weekends of the Brazilian church’s calendar, the celebration of the country’s patron saint.

A similar scene played out far to the north in Belem, near the mouth of the Amazon River, where even the formal cancelation of a usually immense religious celebration didn’t discourage some worshippers — underscoring the church’s challenge of trying to practice precautions at a time when many Brazilians are weary of them.

The sanctuary complex in Aparecida, some 110 miles north of Sao Paulo, hummed with activity on Sunday, even if it was far less busy than in past years. People filed into a snaking line to catch a glimpse of the image of Our Lady of Aparecida; they wore masks, but distancing was negligible.

Many visited a mall filled with 380 shops and a food court. Cable cars whisked people from the basilica to a hilltop with a 75-foot steel cross.

Jhony Gomes, 31, carried a cross over his shoulder on the highway as he drew near to Aparecida. He said he was surprised to find so many fellow pilgrims on the road during the pandemic, but said it reflected the sanctuary’s importance.

“Even if the church had closed, I would’ve brought the cross and left it at the door. … It’s a moment of faith, a time when the world needs more prayer, with all this madness,” he said. “All the pain is worth it. When you see the basilica, it gives you the desire to run. It’s like it pulls on you.”

For the main Mass itself, the church limited each pew to just two worshippers sitting on either end. Church authorities instead asked Brazilians to make their own altar and tune in from home on television or radio, write a letter and share photos on social media of oneself watching services.

Nevertheless, huddled just outside was Zenaide Maria de Jesus, one of several listening to the muffled service through thick, closed wooden doors. She had driven 2½ hours because she needed thank God for, among other things, sparing her son from COVID-19.

“I thought he was going to die. I despaired when he tested positive,” she said. “I asked God to help him make it through and he made it through, thanks to God, and I think I lost a bit of the fear. But even so, you have to take care.”

After the pandemic hit the country in mid-March, Brazil’s National Conference of Bishops suspended in-person Masses and indoor celebrations. But people have grown weary of hunkering down, particularly as the numbers of daily confirmed COVID-19 cases and deaths have declined somewhat from an elevated, months-long plateau.

Brazil’s President Jair Bolsonaro, who is Catholic, throughout the pandemic has encouraged religious leaders to challenge quarantine measures — siding with a sizable number of evangelical pastors who encouraged people to show up for in-person services.

Governors and mayors started relaxing restrictions in June, but it remains rare to find Catholic churches packed in major cities like Sao Paulo and Rio de Janeiro.

Catholic priest Rodrigo Flaibam works in Paulinia, a prosperous city of 100,000 residents in the countryside of São Paulo state. Once a Bolsonaro supporter, he drifted away during the pandemic as he received messages from conservatives insisting he should reopen his church in June.

“Followers were questioning why we were closed if the evangelicals were still open. I was accused of denying the sacrament. It hurt, a lot,” Flaibam said. He reopened for three weeks then decided to close again in July as cases in Paulinia surged.

“The atmosphere of denial was already about, so it was much harder to close that time. And this was created by the president and his allies in evangelical churches, no doubt,” he said.

But even Catholic leaders have grown more relaxed following a long spell of restrictions led by Pope Francis, who lost part of one lung to illness when he was a young man.

The pope set a global example for Catholics by spending months in quarantine to avoid the coronavirus even as leader of many other religions balked at shutdowns. But the pontiff resumed general audiences on Sept. 2.

Critics on social media have complained that he has shunned a mask during his Wednesday general audience, which was held indoors last week. He was seen shaking hands with clerics and otherwise mingling with the masked crowd.

His bodyguards were similarly maskless, and four Swiss Guards, who stand by during papal Masses, have tested positive for coronavirus and were showing symptoms, the Vatican said Monday, as the surge in infections in surrounding Italy penetrates the Vatican walls.

Meanwhile, the Brazilian church cancelled this year’s Procession of Our Lady of Nazareth, which normally draws millions in Belem on the second Sunday of October.

Even so, thousands showed up in the northern Brazilian city to follow the traditional 2-mile route, some advancing on their knees.

“I survived COVID-19 thanks to you, Mother,” read a sign one woman held in her hand. With her other arm, she held a wax sculpture of a lung.

David Biller and Marcelo de Sousa contributed from Rio de Janeiro.