The law of three stages is an idea developed by Auguste Comte in his work The Course in Positive Philosophy. It states that society as a whole, and each particular science, develops through three mentally conceived stages: (1) the theological stage, (2) the metaphysical stage, and (3) the positive stage.
 (1) The Theological stage refers to the appeal to personified deities. During the earlier stages, people believed that all the phenomena of nature are the creation of the divine or supernatural. Adults and children failed to discover the natural causes of various phenomena and hence attributed them to a supernatural or divine power.[unreliable source?] Comte broke this stage into 3 sub-stages:
 (2) The Metaphysical stage is an extension of the theological stage. It refers to explanation by impersonal abstract concepts. People often try to characterize God as an abstract being. They believe that an abstract power or force guides and determines events in the world. Metaphysical thinking discards belief in a concrete God. For example: In Classical Hindu Indian society, the principle of the transmigration of the soul, the conception of rebirth, notions of pursuant were largely governed by metaphysical uphill.
 (3) The Positivity stage, also known as the scientific stage, refers to scientific explanation based on observation, experiment, and comparison. Positive explanations rely upon a distinct method, the scientific method, for their justification. Today people attempt to establish cause and effect relationships. Positivism is a purely intellectual way of looking at the world; as well, it emphasizes observation and classification of data and facts. This is the highest, most evolved behavior according to Comte.
 Comte, however, was conscious of the fact that the three stages of thinking may or do coexist in the same society or in the same mind and may not always be successive.
 Comte proposed a hierarchy of the sciences based on historical sequence, with areas of knowledge passing through these stages in order of complexity. The simplest and most remote areas of knowledge—mechanical or physical—are the first to become scientific. These are followed by the more complex sciences, those considered closest to us.
 The sciences, then, according to Comte's "law", developed in this order: Mathematics; Astronomy; Physics; Chemistry; Biology; Sociology. A science of society is thus the "Queen science" in Comte's hierarchy as it would be the most fundamentally complex. 
Since Comte saw social science as an observation of human behavior and knowledge, his definition of sociology included observing humanity’s development of science itself. Because of this, Comte presented this introspective field of study as the science above all others. Sociology would both complete the body of positive sciences by discussing humanity as the last unstudied scientific field, and would link the fields of science together in human history, showing the "intimate interrelation of scientific and social development".
 To Comte, the law of three stages made development of sociology inevitable and necessary. Comte saw the formation of his law as an active use of sociology, but this formation was dependent on other sciences reaching the positive stage; Comte’s three-stage law would not have evidence for a positive stage without the observed progression of other sciences through these three stages. Thus, sociology and its first law of three stages would be developed after other sciences were developed out of the metaphysical stage, with the observation of these developed sciences becoming the scientific evidence used in a positive stage of sociology. This special dependence on other sciences contributed to Comte’s view of sociology being the most complex. It also provided an explanation for sociology being the last science to be developed.
 Comte saw the results of his three-stage law and sociology as not only inevitable, but good. In Comte’s eyes, the positive stage was not only the most evolved stage, but also the stage best for mankind. Through a continuous development of positive sciences, Comte hoped that humans would perfect their knowledge of the world and make real progress to improve the welfare of humanity. He acclaimed the positive stage as the "highest accomplishment of the human mind"  and as having "natural superiority"  over the other, more primitive stages.
 Overall, Comte saw his law of three stages as the start of the scientific field of sociology as a positive science. He believed this development was the key to completing positive philosophy and would finally allow humans to study every observable aspect of the universe. For Comte, sociology’s human-centered studies would relate the fields of science to each other as progressions in human history and make positive philosophy one coherent body of knowledge. Comte presented the positive stage as the final state of all sciences, which would allow human knowledge to be perfected, leading to human progress.
 Historian William Whewell wrote "Mr. Comte's arrangement of the progress of science as successively metaphysical and positive, is contrary to history in fact, and contrary to sound philosophy in principle." The historian of science H. Floris Cohen has made a significant effort to draw the modern eye towards this first debate on the foundations of positivism.
 In contrast, within an entry dated early October 1838 Charles Darwin wrote in one of his then private notebooks that "M. Comte's idea of a theological state of science [is a] grand idea."