In the religious sense, law can be thought of as the ordering principle of reality; knowledge as revealed by God defining and governing all human affairs. Law, in the religious sense, also includes codes of ethics and morality which are upheld and required by God. Examples include customary Hindu law, Islamic law, and the divine law of the Mosaic code or Torah.
State churches and similar established religions are branches of the governments that establish them. In some jurisdictions, this means that they operate legal systems of their own or play a part in the legal system of those governments. Canon law is one such sort of legal system; it was administered in ecclesiastical courts. In England, the system of equity was originally established by the Church.
In Christianity, law is often contrasted with grace: the contrast here speaks to attempts to gain salvation by obedience to the code of laws, as opposed to seeking salvation through faith in the atonement made by Jesus on the cross. Compare legalism and antinomianism.
Muslims in Islamic societies have traditionally viewed Islamic law as essential to their religious outlook. Traditional Islamic law is called Sharia or Shariah (شريعة). Like most religious cultures, Islam classically drew no distinction between religious and secular life. The Qur'an is the foremost source of Islamic jurisprudence; the second is the Sunnah (the practices of the Prophet, as narrated in reports of his life). The Sunnah is not itself a text like the Qur'an, but is extracted by analysis of the Hadith (Arabic for "report") texts, which contain narrations of the Prophet's sayings, deeds, and actions of his companions he approved. In recent times, Islamic law has often been questioned by liberal movements within Islam.