Cortisol is a steroid
Corticosteroids are a class of steroid hormones that are produced in the adrenal cortex. Corticosteroids are involved in a wide range of physiologic systems such as stress response, immune response and regulation of inflammation, carbohydrate metabolism, protein catabolism, blood electrolyte...

A hormone is a chemical released by a cell or a gland in one part of the body that sends out messages that affect cells in other parts of the organism. Only a small amount of hormone is required to alter cell metabolism. In essence, it is a chemical messenger that transports a signal from one...

, more specifically a glucocorticoid
Glucocorticoids are a class of steroid hormones that bind to the glucocorticoid receptor , which is present in almost every vertebrate animal cell...

, produced by the adrenal gland
Adrenal gland
In mammals, the adrenal glands are endocrine glands that sit atop the kidneys; in humans, the right suprarenal gland is triangular shaped, while the left suprarenal gland is semilunar shaped...

. It is released in response to stress
Stress (medicine)
Stress is a term in psychology and biology, borrowed from physics and engineering and first used in the biological context in the 1930s, which has in more recent decades become commonly used in popular parlance...

 and a low level of blood glucocorticoids. Its primary functions are to increase blood sugar
Blood sugar
The blood sugar concentration or blood glucose level is the amount of glucose present in the blood of a human or animal. Normally in mammals, the body maintains the blood glucose level at a reference range between about 3.6 and 5.8 mM , or 64.8 and 104.4 mg/dL...

 through gluconeogenesis
Gluconeogenesis is a metabolic pathway that results in the generation of glucose from non-carbohydrate carbon substrates such as lactate, glycerol, and glucogenic amino acids....

; suppress the immune system; and aid in fat, protein and carbohydrate metabolism. It also decreases bone formation. During pregnancy, increased production of cortisol between weeks 30-32 initiates production of fetal lung surfactant to promote maturation of the lungs.