The Criminal Code was made law in 1892 by Parliament in accordance with section 91(27) of the Constitution Act, 1867, which gives the federal government the power to make criminal laws in Canada.
Before the Code was enacted, criminal law in this country was a mixture of common and statute law from Britain, along with statute law of the individual provinces and federal legislation since Confederation. In 1890, the Attorney General of Canada tasked a committee with drafting a unified code. On March 8, 1892, Bill 7, The Criminal Code was introduced into Parliament. It brought together much of the existing law across the nation into an orderly system. It did not purport to reduce all the criminal law in Canada into one comprehensive document, as it would still be necessary to refer to the common law. As well, many previously enacted federal statutes were listed in a schedule to the Bill.
The Bill was proclaimed in force on July 1, 1893. The criminal law in Canada then consisted primarily of the Criminal Code and federal legislation preserved in the schedule to the Code. It also consisted of the common law of each province, except where the common law had been altered by federal legislation. Also, any imperial criminal statutes that had not been superseded by Canadian legislation remained in force.
In 1947, the government appointed a Royal Commission to revise the Code, which came into force in 1955. Changes included abolishing all common law offences, offences under Imperial acts and offences under pre-Confederation acts.
Other updates to the Code have happened since then to reflect societal values. For example, laws against vagrancy and anal intercourse have been removed, while new legislation about sharing intimate photos online has been added.