A method of processing a substrate which enables a surface damaged layer
and polishing remnants on the surface of an insulating film to be
removed, and enable the amount removed of the surface damaged layer and
polishing remnants to be controlled easily. An insulating film on a
substrate, which has been revealed by chemical mechanical polishing, is
exposed to an atmosphere of a mixed gas containing ammonia and hydrogen
fluoride under a predetermined pressure. The insulating film which has
been exposed to the atmosphere of the mixed gas is heated to a
predetermined temperature.