ab-initio calculations on the interaction between the single-walled carbon nanotube (SWCN) and the Mg (0001) surface have been reported. It was found that the charge transfer from metal surfaces to the nanotubes takes place depending on both the electronic structures of the nanotubes and the work functions of the metal surfaces. The stable geometries for the nanotube between two consecutive objectives with C-Mg chemical bonds formed. The interaction energy in the most stable geometry is found to be CNT’s structural dependence. Concerning the electronic properties, the most stable structure showed a decrease in the density of states near the Fermi level due to the formation of C-Mg bonds enhancing the metallic character of the nanotube by the contact with the surface. The nature of the nanotube-interface interaction for nanotubes of larger diameters has been also discussed based on the calculated bond order.