Muscular exercise as well as other cellular functions requires oxygen to produce ATP and properly function. This normal function is called aerobic metabolism and does not produce lactic acid if enough oxygen is present. During heavy exercise such as long distance running or any demanding exercise, the body's need for oxygen to produce energy is higher than the oxygen supplied in the blood from respiration. Anaerobic metabolism to some degree then takes place in the muscle and this less ideal energy production produces lactic acid as a waste metabolite. If the oxygen supply is not soon restored, this may lead to accumulation of lactic acid.