SANTIAGO DE COMPOSTELA, Spain -- As in the Middle Ages, so at the turn of the millennium: The price of praying with your feet is swollen ankles, tendinitis and blisters.

Nevertheless, the Camino de Santiago -- the Way of St. James, a pilgrimage trail across northern Spain -- is enjoying its greatest revival since the Middle Ages.

Pilgrims come to Santiago from all continents. They cross the Pyrenees into Roncesvalles, the site of the eighth-century battle immortalized in the "Chanson de Roland" and the start of the main branch of the trail in northern Spain.

They walk through the forests of Navarre and across the windy Castilian plateau, through villages and hamlets and suburban sprawl. They end up in the woods of Galicia, Spain's westernmost province and home to the historic Cathedral of Santiago de Compostela, said to house the remains of St. James, the apostle credited with evangelizing the West.

Some walk by lantern at night or in the dark hours of early morning. But even the lollygaggers and layabouts are nudged out of the pilgrim lodges no later than 8 a.m.

If they're lucky, as at the "albergues" in Castrojeriz or Fromista, they are awakened by their hosts at 6 a.m. to the soothing strains of Gregorian chants and served steaming cups of cafe con leche.

After obsessive ministrations to their feet -- creams and ointments and double layers of high-tech socks being the conventional precautions, garlic cloves strapped to the toes one of the more bizarre ones -- they are out the door, packs on backs and pilgrim staffs in hand, for six or seven hours of walking.

It is a grueling way to spend the day, and inevitably pilgrims query each other about why they are walking the Camino.

A recovered heroin addict from Madrid wants to give thanks to Santiago. "I've been clean five years," says Maravilla Delgado. She is stumbling along painfully, hobbled by blistered and infected feet and holding back sobs. Like many pilgrims, she walked too far too fast in the early stages. At the next village, she stops to rest for a few days.

A Swiss pilgrim who walks the trail barefoot is fulfilling a promise to a friend. A Frenchwoman seeks the remission of sins for a friend who committed suicide. A museum administrator from Canada "simply wanted to go for a walk."

There are architecture buffs and exercise fanatics and a few who attempt to "re-enact" the pilgrimage as it was in the Middle Ages, with era-appropriate footwear and food. A minority perform the pilgrimage as an act of religious devotion.

And there are prisoners. Belgium continues the medieval custom of ordering criminals to walk the Camino in a rite of self-examination.

Accompanied by a warden, the criminals -- about 500 a year -- must be 23 or younger, serving a sentence of no more than three years. They must perform the pilgrimage during the winter, when cold winds sweep across Castilla and rains lash the mountain villages of Galicia.

Pilgrims clog the Camino this Holy Year, when St. James Day falls on a Sunday. In summer, more than 1,500 pilgrims a day poured into Santiago, turning this city of 95,000 into a permanent festival.

At the end of the walk, pilgrims receive the "Compostela," a certificate stating in Latin that the person has traveled at least 60 miles of the Camino on foot or horseback, or 120 miles by bicycle. Proof that one is a true pilgrim and not just a weekend stroller is required in the form of the "credencial," a kind of pilgrim's passport stamped with the colorful seals of the towns along the route.

The renewed popularity of the pilgrimage remains far short of its appeal in the 12th to 15th centuries, when all Europe seemed to be walking to Santiago.

"Not necessarily for reasons of faith," says Xose Ramon Pousa Estevez, a professor at the University of Santiago de Compostela and author of several books on the Camino. "In the Middle Ages, it was difficult to obtain a passage of safe conduct, permission to move anywhere. The pilgrimage was one way out, a sort of medieval tourism."

Dressed in the traditional cloak and pilgrim's hat adorned with a scallop shell, and armed with a staff to fend off wolves and bandits, medieval travelers could enjoy an extended spell away from home along a protected route.

An infrastructure of commercial establishments, monasteries, hospices and churches, including some of Europe's finest examples of Romanesque architecture, developed to protect and cater to the pilgrims.

Most of the vast monasteries along the route are virtually empty. No more than 14 aging nuns remain in the Cistercian convent in Santo Domingo de la Calzada. Sister Emiliana, however, is gracious and welcoming as she swings open the door to the convent. Shelter is offered free of charge, and experienced hands deal with blisters and tendinitis.

Even fewer monks are in Spain's oldest monastery, San Julian de Samos, in Sarria, about 70 miles east of Santiago. Father Augustine, who looks after the 10 monks in their 70s and 80s, grumbles at the pilgrims: "If you were more religious, if you prayed more, we'd have more monks."

Even the most secular pilgrims, however, are moved when they finally arrive in Santiago, and most perform the rituals that mark the end of the pilgrimage: securing the Compostela and attending Mass at the magnificent cathedral.

The colorful Pilgrim's Mass, celebrated daily at noon, is a departure from the traditional Catholic ceremony and offends some of the more devout pilgrims. "It's nothing but a circus," says Damien Bouleau, who walked from Paris to Roncesvalles, then on to Santiago in 55 days.

At the end of the mass, the 175-pound, 5-foot "butafumeiro," called the largest censer in the world, swings spectacularly through the vast nave. When it finally comes to rest, nearly knocking down the "traboleiros" whose task it is to guide it, applause and laughter resound.

The butafumeiro's medieval function was hygienic. When thousands of weary and unwashed pilgrims, malodorous from months of pilgrimage, camped and cooked in the cathedral, the stench was said to have been overpowering.

The raison d'etre of all this devotion, Santiago himself -- or rather, his remains -- is the subject of heated scholarly debate.

It is a matter of Roman Catholic Church dogma that the remains are those of Santiago. And archaeological investigations -- many sponsored by the church -- confirm the existence of a first-century necropolis.

But scholars are skittish about drawing conclusions. They agree only that a tomb was discovered in the ninth century and that a church and the cult of Santiago were established as a result.