Egypt began legal reform in 1875 when it gained independence from the Ottoman Empire in judicial and legal matters, which led to the establishment of the Mixed Courts to deal with foreigners and national courts. This necessitated a need for a set of laws that had secular influence. When Egypt obtained the needed international agreement for the union of its legal system in 1937, it started to draw up a new series of comprehensive codes.