Surrounding the lungs are sets of muscles that are able to cause air to be inhaled or exhaled from the lungs. The principal muscle of respiration in the human body is the diaphragm, a thin sheet of skeletal muscle that forms the floor of the thorax. When the diaphragm contracts, it moves inferiorly a few inches into the abdominal cavity,
expanding the space within the thoracic cavity and pulling air into the lungs. Relaxation of the diaphragm allows air to flow back out the lungs during exhalation. Between the ribs are many small intercostal muscles that assist the diaphragm with expanding and compressing the lungs. These muscles are divided into 2 groups, those are the internal intercostal muscles and the external intercostal muscles. The internal intercostal muscles are the deeper set of muscles and depress the ribs to compress the thoracic cavity and force air to be exhaled from the lungs. The external intercostals are found superficial to the internal intercostals and function to elevate the ribs, expanding the volume of the thoracic cavity and causing air to be inhaled into the lungs.