Herein, we report the first example showing the reversible on-off switching of spin-crossover (SCO) property by solid state photochemical [2+2] reaction. The ultraviolet (UV) light-induced [2+2] cycloaddition reaction of 3-spy ligands in a two-dimensional (2D) Hofmann-type framework [Fe(3-spy)2{Pd(CN)4}] (1, 3-spy=3-styrylpyridine), which shows a hysteretic two-step SCO behavior, gives a 3D Hofmann-type framework [Fe(rctt-3-ppcb){Pd(CN)4}] (2, rctt-3-ppcb=rctt-1,3-bis(3-pyridyl)-2,4-bis(phenyl)cyclobutane, r=reference group, c=cis and t=trans) ...