Histamine
Histamine is an organic nitrogen compound involved in local immune responses as well as regulating physiological function in the gut and acting as a neurotransmitter.  Histamine triggers the inflammatory response.  As part of an immune response to foreign pathogens, histamine is produced by basophils and by mast cells found in nearby connective tissues.  Histamine increases the permeability of the capillaries to white blood cells and other proteins, in order to allow them to engage foreign invaders in the infected tissues. It is found in virtually all animal body cells.

# Properties
Histamine forms colorless hygroscopic crystals that melt at 84C, and are easily dissolved in water or ethanol, but not in ether. In aqueous solution histamine exists in two tautomeric forms, N-H-histamine and N-H-histamine.
Histamine has two basic centres, namely the aliphatic amino group and whichever nitrogen atom of the imidazole ring does not already have a proton. Under physiological conditions, the aliphatic amino group (having a pKa around 9.4) will be protonated, whereas the second nitrogen of the imidazole ring (pKa  5.8) will not be protonated.
Thus, histamine is normally protonated to a singly-charged cation.

# Synthesis and metabolism
Histamine is derived from the decarboxylation of the amino acid histidine, a reaction catalyzed by the enzyme L-histidine decarboxylase. It is a hydrophilic vasoactive amine.
Once formed, histamine is either stored or rapidly inactivated by its primary degradative enzymes, histamine-N-methyltransferase or diamine oxidase. In the central nervous system, histamine released into the synapses is primarily broken down by histamine-N-methyltransferase, while in other tissues both enzymes may play a role. Several other enzymes, including MAO-B and ALDH2, further process the immediate metabolites of histamine for excretion or recycling.
Bacteria also are capable of producing histamine using histidine decarboxylase enzymes unrelated to those found in animals.  A non-infectious form of foodborne disease, scombroid poisoning, is due to histamine production by bacteria in spoiled food, particularly fish.  Fermented foods and beverages naturally contain small quantities of histamine due to a similar conversion performed by fermenting bacteria or yeasts.  Sake contains histamine in the 20-40 mg/L range; wines contain it in the 2-10 mg/L range.  

# Storage and release
Most histamine in the body is generated in granules in mast cells or in white blood cells called basophils.  Mast cells are especially numerous at sites of potential injury - the nose, mouth, and feet, internal body surfaces, and blood vessels.  Non-mast cell histamine is found in several tissues, including the brain, where it functions as a neurotransmitter.  Another important site of histamine storage and release is the enterochromaffin-like (ECL) cell of the stomach.
The most important pathophysiologic mechanism of mast cell and basophil histamine release is immunologic.  These cells, if sensitized by IgE antibodies attached to their membranes, degranulate when exposed to the appropriate antigen.  Certain amines and alkaloids, including such drugs as morphine, and curare alkaloids, can displace histamine in granules and cause its release. Antibiotics like polymyxin are also found to stimulate histamine release.

# Mechanism of action
Histamine exerts its actions by combining with specific cellular histamine receptors. The four histamine receptors that have been discovered are designated H1 through H4, and are all G protein-coupled receptors.

## Effects on Nasal Mucosa
Increased vascular permeability causes fluid to escape from capillaries into the tissues, which leads to the classic symptoms of an allergic reaction  a runny nose and watery eyes.
Allergens can bind to IgE-loaded mast cells in the nasal mucosa, which leads to three clinical responses: sneezing results from histamine-associated sensory neural stimulation; hypersecretion from glandular tissue occurs; nasal mucosal congestion results due to vascular engorgement associated with vasodilation and increased capillary permeability. 

# Roles in the body

## Sleep regulation
Histamine is released as a neurotransmitter. The cell bodies of neurons which release histamine are found in the posterior hypothalamus, in various tuberomammillary nuclei. From here, these histaminergic neurons project throughout the brain, to the cortex through the medial forebrain bundle. Histaminergic action is known to modulate sleep. Classically, antihistamines (H1 histamine receptor antagonists) produce sleep. Likewise, destruction of histamine releasing neurons, or inhibition of histamine synthesis leads to an inability to maintain vigilance. Finally, H3 receptor antagonists increase wakefulness.
It has been shown that histaminergic cells have the most wakefulness-related firing pattern of any neuronal type thus far recorded. They fire rapidly during waking, fire more slowly during periods of relaxation/tiredness and completely stop firing during REM and NREM (non-REM) sleep. Histaminergic cells can be recorded firing just before an animal shows signs of waking.

## Suppressive effects
While histamine has stimulatory effects upon neurons, it also has  suppressive ones that protect against the  susceptibility to convulsion, drug sensitization, denervation supersensitivity, ischemic lesions and stress. It has also been suggested that histamine controls the mechanisms by which memories and learning are forgotten.

## Erection and sexual function
Libido loss and erectile failure can occur following histamine (H2) antagonists such as cimetidine and ranitidine. The injection of histamine into the corpus cavernosum in men with psychogenic impotence  produces full or partial erections in 74% of them. It has been suggested that H2 antagonists may cause sexual difficulties by reducing the uptake of testosterone.

## Schizophrenia
Metabolites of histamine are increased in the cerebrospinal fluid of people with schizophrenia, while the efficiency of H(1) receptor binding sites is decreased. Many atypical antipsychotic medications have the effect of increasing histamine turnover.

# Disorders
As an integral part of the immune system, histamine may be involved in immune system disorders and allergies.

# Nomenclature
"H substance" or "substance H" are occasionally used in medical literature for histamine or a hypothetical histamine-like diffusible substance released in allergic reactions of skin and in the responses of tissue to inflammation.