In the lungs, oxygen and carbon dioxide (a waste product of body processes) are exchanged in the tiny air sacs (alveoli) at the end of the bronchial tubes. The alveoli are surrounded by capillaries. When a person inhales, oxygen moves from the alveoli to the surrounding capillaries and into the bloodstream. At the same time, carbon dioxide moves from the bloodstream to the capillaries and into the alveoli. The carbon dioxide is removed from the lungs when a person exhales.