According to the invention, an apparatus for extracorporeal oxygenation of a patients blood during cardiopulmonary bypass surgery comprises a bubble sensor 101, arranged at or connected to a venous line 100, for detecting bubbles in the venous blood received from the patient. When air bubbles are detected a second pump 109 is activated to draw air from an air chamber 103 provided in an air filter 102 connected to the venous line 100 and arranged downstream of said bubble sensor 101. A first pump 105 draws the blood from the air filter 102 and supplies the blood to an oxygenator 106 and to the patient via arterial line 107.