Customary international law are those aspects of international law that derive from custom. Along with general principles of law and treaties, custom is considered by the International Court of Justice, jurists, the United Nations, and its member states to be among the primary sources of international law.
For example, laws of war were long a matter of customary law before they were codified in the Hague Conventions of 1899 and 1907, Geneva Conventions, and other treaties.
The vast majority of the world's governments accept in principle the existence of customary international law, although there are many differing opinions as to what rules are contained in it.
The Statute of the International Court of Justice acknowledges the existence of customary international law in Article 38(1)(b), incorporated into the United Nations Charter by Article 92: "The Court, whose function is to decide in accordance with international law such disputes as are submitted to it, shall apply...international custom, as evidence of a general practice accepted as law."
Customary international law "... consists of rules of law derived from the consistent conduct of States acting out of the belief that the law required them to act that way." It follows that customary international law can be discerned by a "widespread repetition by States of similar international acts over time (State practice); Acts must occur out of sense of obligation (opinio juris); Acts must be taken by a significant number of States and not be rejected by a significant number of States." A marker of customary international law is consensus among states exhibited both by widespread conduct and a discernible sense of obligation.
The International Court of Justice (case of USA vs Nicaragua in 1989) held that the elements of an international customary law would be Opinio Yuris (Past Judge Decisions or works of the most highly qualified publicists) which is then proven by existing state practices.
A peremptory norm (also called jus cogens, Latin for "compelling law") is a fundamental principle of international law which is accepted by the international community of states as a norm from which no derogation is ever permitted. Examples include various international crimes; a state which carries out or permits slavery, torture, genocide, war of aggression, or crimes against humanity is always violating customary international law.
Other examples accepted or claimed as customary international law include the principle of non-refoulement, immunity of visiting foreign heads of state, and the right to humanitarian intervention.