In psychoanalytic theory, a defence mechanism (American English: defense mechanism) is an unconscious psychological operation that functions to protect a person from anxiety-producing thoughts and feelings related to internal conflicts and outer stressors.
Defence mechanisms (Abwehrmechanismen) are unconscious psychological processes employed to defend against feelings of anxiety and unacceptable impulses at the level of consciousness. These processes include: repression, the exclusion of unacceptable desires and ideas from consciousness, though in certain circumstances they may resurface in a disguised or distorted form; identification, the incorporation of some aspects of an object into oneself, employed by the ego and superego to fortify the personality by attracting libido (sexual energy) away from objects and toward themselves; rationalization, the justification of one's behaviour by using apparently logical reasons that are acceptable to the ego, thereby further suppressing awareness of the unconscious motivations; and sublimation, the process of channeling libido into "socially useful" disciplines, such as artistic, cultural, and intellectual pursuits, which indirectly provide gratification for the original drives.
According to this theory, healthy people normally use different defence mechanisms throughout life. A defence mechanism becomes pathological only when its persistent use leads to maladaptive behaviour such that the physical or mental health of the individual is adversely affected. Among the purposes of ego defence mechanisms is to protect the mind/self/ego from anxiety or social sanctions or to provide a refuge from a situation with which one cannot currently cope.
In the first definitive book on defence mechanisms, The Ego and the Mechanisms of Defence (1936), Anna Freud enumerated the ten defence mechanisms that appear in the works of her father, Sigmund Freud: repression, regression, reaction formation, isolation, undoing, projection, introjection, turning against one's own person, reversal into the opposite, and sublimation or displacement.