A cardiopulmonary bypass (CPB) or heart-lung machine is a machine that temporarily takes over the function of the heart and lungs during cardiac surgery. It maintains the circulation of oxygenated blood throughout the body during the surgery. It is also used to cool the circulating blood and hence the body, in order to stop the heart to allow surgical intervention within a static heart.