2 At the very beginning of Our pontificate We clearly pointed out what the peril was which confronted society on this head, and We deemed it Our duty to warn Catholics, in unmistakable language,(1) how great the error was which was lurking in the utterances of socialism, and how great the danger was that threatened not only their temporal possessions, but also their morality and religion. That was the purpose of Our encyclical letter Quod Apostolici Muneris which We published on the 28th of December in the year 1878; but, as these dangers day by day threatened still greater disaster, both to individuals and the commonwealth, We strove with all the more energy to avert them. This was the object of Our encyclical Rerum Novarum of the 15th of May, 1891, in which we dwelt at length on the rights and duties which both classes of society - those namely, who control capital, and those who contribute labor - are bound in relation to each other; and at the same time, We made it evident that the remedies which are most useful to protect the cause of religion, and to terminate the contest between the different classes of society, were to be found in the precepts of the Gospel.
Source: Graves de Communi Re (Vatican.va)