We show how a spin interaction between electrons localized in neighboring quantum dots can be induced and controlled optically. The coupling is generated via virtual excitation of delocalized excitons and provides an efficient coherent control of the spins. This quantum manipulation can be realized in the adiabatic limit and is robust against decoherence by spontaneous emission. Applications to the realization of quantum gates, scalable quantum computers, and to the control of magnetization in an array of charged dots are proposed.