Objective To evaluate the effect of cardiopulmonary bypass (CPB) on pulmonary function in infants with variable pulmonary arterial pressure resulting from congenital ventricular septal defect (VSD). Methods Twenty infants with VSD underwent corrective surgery were divided into pulmonary hypertension group (n= 10) and non-pulmonary hypertension group (n= 10) according to with pulmonary hypertension or not. Pulmonary function was measured before CPB , 3h,6h,9h,12h,15h,18h,21h, and 24h after CPB and duration for mechanical ventilation and cardiac intensive care unit stay were recorded. Results Pulmonary function parameters before CPB in nonpulmonary hypertension group were superior to those in pulmonary hypertension group (P〈0.01), and pulmonary function parameters after CPB deteriorated than those before CPB (P〈0.05), especially 9h,12h and 15h after CPB (P〈0.01). Compared to pulmonary function parameters before CPB, pulmonary function parameters of pulmonary hypertension group at 3h after CPB were improved (P〉0.05), but they deteriorated at 9h,12h and 15h after CPB (P〈0. 05). Pulmonary function parameters at 21h and 24h after CPB was recoverd to those before CPB in two groups. Conclusions Although exposure to CPB affects pulmonary function after VSD repair in infants, the benefits of the surgical correction to patients with pulmonary hypertension outweigh the negative effects of CPB on pulmonary function. Improvement of cardiac function can avoid the nadir of pulmonary function decreasing. The infants with pulmonary hypertension will be weaned off from mechanical ventilator as soon as possible, if hemodynamics is stable, without the responsive pulmonary hypertension or pulmonary hypertension crisis after operation.