The effect of SiO2 layers during the thermal oxidation of a 4H-SiC(0001) substrate is examined by performing the first-principles total-energy calculations. Although it is expected that a CO molecule is the most preferable product during the oxidation, CO2 molecules are mainly emitted from the SiC surface at the initial stage of the oxidation. As the oxidation proceeds, CO2 emission becomes less favorable and CO molecules are emitted from the interface. We conclude that the interface stress due to the lattice constant mismatch between 4H-SiC(0001) and SiO2 is responsible for the removal of C during the oxidation, resulting in the characteristic electronic property of the interface fabricated by the thermal oxidation.