The spin crossover from high-spin (HS) to low-spin (LS) magnetic state of a single Fe(phen)(2)(NCS)(2) molecule adsorbed onto a metallic substrate is shown to be possible by means of density functional theory. The calculation also shows that a monolayer of nitrogen on Cu(001) reduces drastically the molecule-surface adsorption energy and chemical bonding, making the molecule switchable between its two magnetic states by means of an external stimuli, as observed experimentally. To show that the spin transition is not strongly affected by the type of exchange and correlation potential, both the generalized-gradient approximation (GGA) and the so-called GGA + U method have been used including weak van der Waals interactions. The calculated scanning tunneling microscopy (STM) images of the HS and LS states within the Hamann-Tersoff approximation explain correctly the experimental data. DOI: 10.1103/PhysRevB.87.144413