During travels to Central and South America, I've often seen natives, including old men and women either crawling or walking on their knees for nearly a mile to one shrine or another. In talking with the Catholic priests (sometimes Jesuits but more likely Franciscans) it's seen as a sign of pennance and sometimes discouraged by the Roman Church. It's usually prompted by the sometimes volatile mix of the pre-existing nativistic beliefs (pre-Spanish) and Church's promotion of indulgences during the Conquistadore's invasion.
It's fair to say that the practice was prevalent during the middle ages in Europe as well. De'aubigne writes "...�In the eleventh century voluntary flagellations were super added to these practices; somewhat later they become quite a mania in Italy, which was then in a very disturbed state. Nobles and peasants, old and young, even children of five years of age, whose only covering was a cloth tied round the middle, went in pairs, by hundreds, thousands, and tens of thousands, through the towns and villages, visiting the churches in the depth of winter. Armed with scourges, they flogged each other without pity, and the streets resounded with cries and groans that drew tears from all who heard them...�