An embedded cluster approach is applied to study the electronic excitations on the NiO(001) surface. Starting from the unrestricted Hartree-Fock level of theory, we calculate the ground-state properties to provide some insight into electronic structure and excitations and we estimate the excitation energies and oscillator strengths using the single excitation configuration-interaction (CIS) technique. We compute the second harmonic generation (SHG) tensor for the Ni0(001) surface, using the many-body wave functions and energies resulting from double excitation configuration-interaction (CID) and quadratic configuration-interaction with single and double excitations, and energy contributions from triple excitations [QCISD(T)] calculations. From that, the intensity of the nonlinear optical response as a function of photon energy at different polarizations of the incident and outgoing photons is obtained. Combining optical control theory with the ab initio results and the crystal field theory, the laser induced femtosecond spin dynamics is explored. A scenario for ultrafast all-optical magnetic switching that results from the combination of spin-orbit coupling with appropriately shaped short laser pulses is proposed. The application of the theory to the multiplet states within the gap of NiO(001) is found to predict the possibility of alloptical spin switching within 150 femtoseconds.