Nanostructure fabrication using lasers in combination with a scanning tunneling microscope has been reported in the past several years. Different mechanisms have been discussed for the formation of these nanostructures. However, they are controversial. In this study, we investigated the mechanism of nanostructure fabrication on both gold films and hydrogen-passivated Ge surfaces. Current-distance curves for a gold film and for an H-passivated Ge surface under an electrochemically etched tungsten tip were measured to determine the tip-sample distance. An analytical model was proposed to explain different mechanisms for nanostructure fabrication on gold films and on H-passivated Ge surfaces. Thermal expansion of the tip under laser irradiation was calculated. With comparison between the tip-sample distance and the thermal expansion of the tip, we can determine whether the mechanism is based on optical enhancement or on thermal mechanical indentation. © 2000 American Institute of Physics.