The 1917 Code of Canon Law, also referred to as the Pio-Benedictine Code, was the first official comprehensive codification of Latin canon law. It was promulgated on 27 May 1917 and took legal effect on 19 May 1918. It was in force until the 1983 Code of Canon Law took legal effect and abrogated it on 27 November 1983. It has been described as "the greatest revolution in canon law since the time of Gratian" (1150s AD).
Papal attempts at codification of the scattered mass of canon law spanned the eight centuries since Gratian produced his Decretum c. 1150. In the 13th century especially canon law became the object of scientific study and different compilations were made by the Roman pontiffs. The most important of these were the five books of the Decretales Gregorii IX and the Liber Sextus of Bonaface VIII. Legislation grew with time. Some of it became obsolete and contradictions crept in so that it became difficult in recent times to discover what was of obligation and where to find the law on a particular question.
When the Vatican Council met in 1869 a number of bishops of different countries petitioned for a new compilation of church law that would be clear and easily studied. The council never finished its work and no attempt was made to bring the legislation up to date. By the 19th Century, this body of legislation included some 10,000 norms. Many of these were difficult to reconcile with one another due to changes in circumstances and practice. This situation impelled Pope St. Pius X to order the creation of the first Code of Canon Law, a single volume of clearly stated laws.
In response to the request of the bishops at the First Vatican Council, on 14 May 1904, with the motu proprio Arduum sane munus ("A Truly Arduous Task"), Pope Pius X set up a commission to begin reducing these diverse documents into a single code, presenting the normative portion in the form of systematic short canons shorn of the preliminary considerations ("Whereas...") and omitting those parts that had been superseded by later developments.