You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Necrophilia and explain in detail?
Necrophilia, also known as necrophilism, necrolagnia, necrocoitus, necrochlesis, and thanatophilia, is sexual attraction towards or a sexual act involving corpses. It is classified as a paraphilia by the World Health Organization (WHO) in its International Classification of Diseases (ICD) diagnostic manual, as well as by the American Psychiatric Association in its Diagnostic and Statistical Manual (DSM).

Origins of term
Various terms for the crime of corpse-violation animate sixteenth- through nineteenth-century works on law and legal medicine. The plural term "nécrophiles" was coined by Belgian physician Joseph Guislain in his lecture series, Leçons Orales Sur Les Phrénopathies, given around 1850, about the contemporary necrophiliac François Bertrand:
It is within the category of the destructive madmen [aliénés destructeurs] that one needs to situate certain patients to whom I would like to give the name of necrophiliacs [nécrophiles]. The alienists have adopted, as a new form, the case of Sergeant Bertrand, the disinterrer of cadavers on whom all the newspapers have recently reported. However, dont think that we are dealing here with a form of phrenopathy which appears for the first time. The ancients, in speaking about lycanthropy, have cited examples to which one can more or less relate the case which has just now attracted the public attention so strongly.
Psychiatrist Bénédict Morel popularised the term about a decade later when discussing Bertrand.

History
In the ancient world, sailors returning corpses to their home country were often accused of necrophilia. Singular accounts of necrophilia in history are sporadic, though written records suggest the practice was present within Ancient Egypt. Herodotus writes in The Histories that, to discourage intercourse with a corpse, ancient Egyptians left deceased beautiful women to decay for "three or four days" before giving them to the embalmers. Herodotus also alluded to suggestions that the Greek tyrant Periander had defiled the corpse of his wife, employing a metaphor: "Periander baked his bread in a cold oven." Acts of necrophilia are depicted on ceramics from the Moche culture, which reigned in northern Peru from the first to eighth century CE. A common theme in these artifacts is the masturbation of a male skeleton by a living woman. Hittite law from the 16th century BC through to the 13th century BC explicitly permitted sex with the dead. In what is now Northeast China, the ethnic Xianbei emperor Murong Xi (385–407) of the Later Yan state had intercourse with the corpse of his beloved empress Fu Xunying, after the latter was already cold and put into the coffin.In Renaissance Italy, following the reputed moral collapse brought about by the Black Death and before the Roman Inquisition of the Counter-Reformation, literature was replete with sexual references; these include necrophilia, as in the epic poem Orlando Innamorato by Matteo Maria Boiardo, first published in 1483. In a notorious modern example, American serial killer Jeffrey Dahmer was a necrophiliac. Dahmer wanted to create a sex slave who would mindlessly consent to whatever he wanted. When his attempts failed, and his male victim died, he would keep the corpse until it decomposed beyond recognition,  masturbating and performing sexual intercourse on the body. He would perform sexual activities before and after murdering his victims. Dahmer explained that he only killed his victims because he did not want them to leave.
More modern necrophiliacs include Scottish serial killer Dennis Nilsen, and English David Fuller, who is considered the worst offender of this kind in English legal history.Havelock Ellis, in his 1903 volume of Studies of the Psychology of Sex, believed that necrophilia was related to algolagnia, in that both involve the transformation of a supposed negative emotion, such as anger, fear, disgust, or grief, into sexual desire.

Classification
In the Diagnostic and Statistical Manual of Mental Disorders, fifth edition (DSM-5), recurrent, intense sexual interest in corpses can be diagnosed under Other Specified Paraphilic Disorder (necrophilia) when it causes marked distress or impairment in important areas of functioning.Forensic Psychologist Anil Aggrawal introduced a ten tier classification of necrophiliacs based on increasing severity of disorder.
Additionally, criminologist Lee Mellors typology of homicidal necrophiliacs consists of eight categories (A–H) and is based on the combination of two behavioural axes: destructive (offender mutilates the corpse for sexual reasons) – preservative (offender does not), and cold (offender used the corpse sexually two hours or more after death) – warm (offender used the corpse sexually less than two hours after death). This renders four categories (A-D) to which Mellor adds an additional four (E-H):

Category A (cold/destructive), e.g. Ted Bundy, Jeffrey Dahmer
Category B (cold/preservative), e.g. Gary Ridgway, Dennis Nilsen, Carl Tanzler
Category C (warm/destructive) e.g. Andrei Chikatilo, Joseph Vacher
Category D (warm/preservative) e.g. Robert Yates, Earle Nelson
Category E (dabblers) e.g. Richard Ramirez, Mark Dixie
Category F (catathymic⁠ ⁠— impulsively and explosively lashing out)
Category G (exclusive necromutilophiles) e.g. Robert Napper, Peter Sutcliffe
Category H (sexual cannibals & vampires) e.g. Albert Fish, Peter KürtenDabblers have transitory opportunistic sexual relations with corpses, but do not prefer them. Catathymic necrophiliacs commit postmortem sex acts only while in a sudden impulsive state. Exclusive necromutilophiles derive pleasure purely from mutilating the corpse, while sexual cannibals and vampires are sexually aroused by eating human body parts. Category A, C, and F offenders may also cannibalise or drink the blood of their victims.

Research
Humans
Necrophilia is often assumed to be rare, but no data for its prevalence in the general population exists. Some necrophiliacs only fantasise about the act, without carrying it out.  In 1958, Klaf and Brown commented that, although rarely described, necrophiliac fantasies may occur more often than is generally supposed.Rosman and Resnick (1989) reviewed 123 cases of necrophilia. The sample was divided into genuine necrophiliacs, who had a persistent attraction to corpses, and pseudo-necrophiliacs, who acted out of opportunity, sadism, or transient interest.  Of the total, 92% were male and 8% were female. 57% of the genuine necrophiliacs had occupational access to corpses, with morgue attendants, hospital orderly, and cemetery employees being the most common jobs. The researchers theorised that either of the following situations could be antecedents to necrophilia:
The necrophiliac develops poor self-esteem, perhaps due in part to a significant loss;
(a) They are very fearful of rejection by others and they desire a sexual partner who is incapable of rejecting them; and/or
(b) They are fearful of the dead, and transform their fear—by means of reaction formation—into a desire.
They develop an exciting fantasy of sex with a corpse, sometimes after exposure to a corpse.

Motives
The most common motive for necrophiliacs is the possession of a partner who is unable to resist or reject them. However, in the past, necrophiliacs have expressed having more than one motive.The authors reported that of their sample of 34 genuine necrophiliacs:
68% were motivated by a desire for a non-resisting and non-rejecting partner
21% were motivated by a want for a reunion with a lost partner
15% were motivated by sexual attraction to dead people
15% were motivated by a desire for comfort or to overcome feelings of isolation
12% were motivated by a desire to remedy low self-esteem by expressing power over a corpseLesser common motives include:

Unavailability of a living partner
Compensation for a fear of women
Belief that sex with a living woman is a mortal sin
Need to achieve a feeling of total control over a sexual partner
Compliance with a command hallucination
Performance of a series of destructive acts
Expression of polymorphous perverse sexual desires
Need to perform limitless sexual activityIQ data was limited, but not abnormally low. About half of the sample had a personality disorder, and 11% of true necrophiliacs were psychotic. Rosman and Resnick concluded that their data challenged the conventional view of necrophiliacs as generally psychotic, mentally deficient, or unable to obtain a consenting partner.

Other animals
Necrophilia has been observed in mammals, birds, reptiles and frogs. In 1960, Robert Dickerman described necrophilia in ground squirrels, which he termed "Davian behaviour" in reference to a limerick about a necrophiliac miner named Dave. The label is still used for necrophilia in animals. Certain species of arachnids and insects practice sexual cannibalism, where the female cannibalises her male mate before, during, or after copulation.
Kees Moeliker made an observation while he was sitting in his office at the Natural History Museum Rotterdam, when he heard the distinctive thud of a bird hitting the glass facade of the building. Upon inspection, he discovered a drake (male) mallard lying dead outside the building. Next to the downed bird, a second drake mallard was standing close by. As Moeliker observed the couple, the living drake pecked at the corpse of the dead one for a few minutes then mounted the corpse and began copulating with it. The act of necrophilia lasted for about 75 minutes, in which time, according to Moeliker, the living drake took two short breaks before resuming with copulating behaviour. Moeliker surmised that at the time of the collision with the window the two mallards were engaged in a common pattern in duck behaviour called "attempted rape flight". "When one died the other one just went for it and didnt get any negative feedback – well, didnt get any feedback," according to Moeliker. Necrophilia had previously only been reported in heterosexual mallard pairs.In a short paper known as "Sexual Habits of the Adélie Penguin", deemed too shocking for contemporary publication, George Murray Levick described "little hooligan bands" of penguins mating with dead females in the Cape Adare rookery, the largest group of Adélie penguins, in 1911 and 1912. This is nowadays ascribed to lack of experience of young penguins; a dead female, with eyes half-closed, closely resembles a compliant female. A gentoo penguin was observed attempting to have intercourse with a dead penguin in 1921.A male New Zealand sea lion was once observed attempting to copulate with a dead female New Zealand fur seal in the wild. The sea lion nudged the seal repeatedly, then mounted her and made several pelvic thrusts. Approximately ten minutes later, the sea lion became disturbed by the researchers presence, dragged the corpse of the seal into the water, and swam away while holding it. A male sea otter was observed holding a female sea otter underwater until she drowned before repeatedly copulating with her carcass. Several months later, the same sea otter was again observed copulating with the carcass of a different female. Copulation with a dead female pilot whale by a captive male pilot whale has been observed, and possible sexual behaviour between two male humpback whales, one dead, has also been reported.In 1983, a male rock dove was observed to be copulating with the corpse of a dove that shortly before had its head crushed by a car. In 2001, a researcher laid out sand martin corpses to attract flocks of other sand martins. In each of six trials, 1–5 individuals from flocks of 50–500 were observed attempting to copulate with the dead sand martins. This occurred one to two months after the breeding season; since copulation outside the breeding season is uncommon among birds, the researcher speculated that the lack of resistance by the corpses stimulated the behaviour. Charles Brown observed at least ten cliff swallows attempt to copulate with a road-killed cliff swallow in the space of 15 minutes. He commented, "This isnt the first time Ive seen cliff swallows do this; the bright orange rump sticking up seems to be all the stimulus these birds need." Necrophilia has also been reported in the European swallow, grey-backed sparrow-lark, Starks lark, and the snow goose. A Norwegian television report showed a male hybrid between a black grouse and western capercaillie kill a male black grouse before attempting to copulate with it. In 2015, due to work done by the University of Washington, it was found that crows would commit necrophilia on dead crow corpses in about 4% of encounters with corpses.

Necrophilia has been documented in various lizard species, including  Ameiva ameiva, the leopard lizard, and Holbrookia maculata. There are two reports of necrophilic behaviour in the sleepy lizard (Tiliqua rugosa). In one, the partner of a male lizard got caught in fencing wire and died. The male continued to display courtship behaviour towards his partner two days after her death. This lizards necrophilia was believed to stem from its strong monogamous bond. In one study of black and white tegu lizards, two different males were observed attempting to court and copulate with a single female corpse on two consecutive days. On the first day, the corpse was freshly dead, but by the second day it was bloating and emitting a strong putrid odor. The researcher attributed the behaviour to sex pheromones still acting on the carcass.Male garter snakes often copulate with dead females. One case has been reported in the Bothrops jararaca snake with a dead South American rattlesnake. The prairie rattlesnake (Crotalus viridis) and Helicops carinicauda snake have both been seen attempting to mate with decapitated females, presumably attracted by still-active sex pheromones. Male crayfish sometimes copulate with dead crayfish of either sex, and in one observation with a dead crayfish of a different species.In anurans, it has been observed in the foothill yellow-legged frog, the yellow fire-bellied toad, the common frog, the Oregon spotted frog, the common Asian Toad, Dendropsophus columbianus, and Rhinella jimi. The film Cane Toads: An Unnatural History shows a male toad copulating with a female toad that had been run over by a car for eight hours. Necrophilic amplexus in frogs may occur because males will mount any pliable object the size of an adult female. If the mounted object is a live frog not appropriate for mating, it will vibrate its body or vocalise a call to be released. Dead frogs cannot do this, so they may be held for hours. The Amazonian frog Rhinella proboscidea sometimes practices what has been termed "functional necrophilia": a male grasps the corpse of a dead female and squeezes it until its oocytes are ejected before fertilising them.

Treatment
Treatment for necrophilia is similar to that prescribed for most paraphilias. Besides advocating treatment of the associated psychopathology, there is little known on the treatment of necrophilia. There has not been a sufficient number of necrophiliacs to establish any effective treatments. However, based on the available data, clinicians are suggested to:

Determine whether or not a patient has necrophilia
Treat any psychopathology that is associated with necrophilia
Establish psycho-therapeutic rapport
Provide male patients with heightened sex drives with anti-androgens
Help patients find a normal sexual relationship
Help divert the necrophilic fantasies to a living object via desensitization

Case studies
Jeffrey Dahmer
Serial killer Jeffrey Dahmer (1960–1994) was known to perform oral sex or masturbate, or both, upon the corpses of his victims before dismembering them. In unguarded, taped interviews with his defense attorney, Wendy Patrickus, Jeffrey Dahmer explicitly stated that he had sex with his victims before and after their deaths. He explained that he wanted to remain with the person as long as possible, preserving some of his victims selected organs, skeletal tissue and bones.

Ted Bundy
Ted Bundy (1946–1989) was an American serial killer who raped and murdered at least 30 young women during the 1970s. He also confessed to participating in necrophilic acts, claiming to have chosen secluded disposal sites for his victims bodies specifically for post-mortem sexual intercourse.

Karen Greenlee
In 1987, Karen Greenlee gave a detailed interview called “The Unrepentant Necrophile” for Jim Mortons (edited by Adam Parafrey) book Apocalypse Culture. In this interview, she stated that she had a preference for younger men and was attracted to the smell of blood and death. She considered necrophilia an addiction. The interview was held in her apartment, which was apparently a small studio filled with books, necrophilic drawings, and satanic adornments. She also had written a confession letter in which she claimed to have abused 20–40 male corpses.

Dennis Nilsen
Dennis Nilsen (1945–2018) was a Scottish serial killer who had developed an association between death and intimacy, later finding posing as a corpse a source of sexual arousal. In 1978, Nilsen committed his first murder and had intercourse with the victims corpse, keeping the body for months before disposal. Nilsen was reported to have sexually abused the corpses of various victims until his arrest.

Legality
Australia
Necrophilia is not explicitly mentioned in Australian law; however, under the Crimes Act 1900 – Sect 81C, penalised for misconduct with regard to corpses is any person who:(a) indecently interferes with any dead human body, or
(b) improperly interferes with, or offers any indignity to, any dead human body or human remains (whether buried or not), and

shall be liable to imprisonment for two years.

Brazil
Article 212 of the Brazilian Penal Code (federal Decree-Law No 2.848) states as follows:
Art. 212 – To abuse a cadaver or its ashes:Penalty: detention, from 1 to 3 years, plus fine.
Although sex with a corpse is not explicitly mentioned, a person who has sex with a corpse may be convicted of a crime under the above Article. The legal asset protected by such Article is not the corpses objective honour, but the feeling of good memories, respect, and veneration that living people keep about the deceased person: these persons are considered passive subjects of the corpses violation.

India
Section 297 of the Indian Penal Code entitled "Trespassing on burial places, etc.", states as follows:
Whoever, with the intention of wounding the feelings of any person, or of insulting the religion of any person, or with the knowledge that the feelings of any person are likely to be wounded, or that the religion of any person is likely to be insulted thereby,
commits any trespass in any place of worship or on any place of sculpture, or any place set apart from the performance of funeral rites or as a depository for the remains of the dead, or offers any indignity to any human corpse, or causes disturbance to any persons assembled for the performance of funeral ceremonies, shall be punished with imprisonment of either description for a term which may extend to one year, or with fine, or with both.
Although sex with a corpse is not explicitly mentioned, a person who has sex with a corpse may be convicted under the above section. Section 377 of the Indian Penal Code can also be invoked.

Philippines
There are no laws which explicitly prohibit sexual acts on corpses. The closest applicable law is the provision in the Revised Penal Code which only criminalizes "defamation to blacken the memory of one who is dead". There were at least efforts to introduce bills criminalizing sexual acts on corpses during the 15th Congress; one by which penalizes sexual acts of males of corpses of women, and another which covers sexual intercourse, anal sex, and oral sex done on corpses. Both proposals penalizes the act with fine and imprisonment.

New Zealand
Under Section 150 of the New Zealand Crimes Act 1961, it is an offence for there to be "misconduct in respect to human remains". Subsection (b) elaborates that this applies if someone "improperly or indecently interferes with or offers indignity to any dead human body or human remains, whether buried or not". This statute is therefore applicable to sex with corpses and carries a potential two-year prison sentence, although there is no relevant case law.

South Africa
Section 14 of the Criminal Law (Sexual Offences and Related Matters) Amendment Act, 2007 prohibits the commission of a sexual act with a corpse. Until codified by the act it was a common law offence.

Sweden
Section 16, § 10 of the Swedish Penal Code criminalises necrophilia, but it is not explicitly mentioned. Necrophilia falls under the regulations against abusing a corpse or grave (Brott mot griftefrid), which carries a maximum sentence of two years in prison. One person has been convicted of necrophilia. He was sentenced to psychiatric care for that and other crimes, including arson.

United Kingdom
Sexual penetration of a corpse was made illegal under the Sexual Offences Act 2003, carrying a maximum sentence of two years imprisonment. Prior to 2003, necrophilia was not illegal; however, exposing a naked corpse in public was classed as a public nuisance (R v. Clark [1883] 15 Cox 171).

United States
There is no federal legislation specifically barring sex with a corpse. Multiple states have their own laws:

See also
Incidents of necrophilia
Necrophilia in popular culture
Vulnerability and care theory of love
Death during consensual sex
Somnophilia
Paraphilias

Footnotes
Sources
Aggrawal, Anil (2010). Necrophilia: Forensic and Medico-legal Aspects. Boca Raton, Florida: CRC Press. ISBN 978-1420089127.
Aggrawal, Anil (19 April 2016). Necrophilia: Forensic and Medico-legal Aspects. CRC Press. ISBN 978-1-4200-8913-4.
Finbow, Steve (2014). Grave Desire: A Cultural History of Necrophilia. Winchester, UK: Zero Books. ISBN 978-1-7827-9342-7.
Lee Mellor (2016) Homicide: A Forensic Psychology Casebook. CRC Press. ISBN 9781498731522.
Purcell, Catherine; Arrigo, Bruce A. (7 June 2006). The Psychology of Lust Murder: Paraphilia, Sexual Killing, and Serial Homicide