Excerpt: Thus, in search of reasons, contagion was considered a divine judgement on people's sins. Extreme solutions to this were found by the supporters of the flagellation movement, who, during the first plague of 1347-53. wandered around communities in masse in apologetic self-thrashing to put an end to the epidemic. This happened across Hungary and the rest of Europe.
image from Wikipedia.