Sharia
Criminal cases were usually handled in maẓālim courts. These courts were controlled by the ruler's council. Mazalim courts were supposed to follow "the spirit of sharia". Qadis and muftis were present in those courts to make sure the verdicts did not go against it. However, these courts did not necessarily follow the letter of the law, and they had fewer legal restrictions than qadi's courts. Mazalim courts also handled complaints against government officials. Their purpose of mazalim courts was to "right wrongs" which could not be addressed through procedures of qadi's courts. Less serious crimes were often handled by local police and market inspectors according to local customs, which were only loosely related to sharia.