When a molecule is subjected to a short intense laser pulse, the ensuing dynamical processes depend qualitatively on the pulse parameters, including duration, frequency, and fluence. Here we report studies of cis to trans photoisomerization of azobenzene following femtosecond-scale laser pulses which are relatively short (10 fs) or long (100 fs) and which have a central frequency matched to either the first excited state (S1, or HOMO to LUMO in a molecular orbital picture) or the second (S2, or HOMO-1 to LUMO). The results presented here demonstrate that photoisomerization involves a rather intricate sequence of connected steps, with the nuclear and electronic degrees of freedom inextricably coupled. One important feature is the de-excitation required for the molecule to achieve its new ground-state after isomerization. If the primary excitation is to S1, then we find that only a single HOMO/LUMO avoided crossing is required and that this crossing occurs halfway along a rotational pathway involving the central CNNC dihedral angle. If the primary excitation is to S2, then the same HOMO/LUMO avoided crossing is observed, but it must be preceded by another avoided crossing that permits transfer of holes from the HOMO-1 to the HOMO, so that the HOMO is then able to accept electrons from the LUMO. We find that this earlier crossing can occur in either of two geometries, one near the cis configuration and the other near the trans. The fact that S2 (pi pi*) isomerization requires two steps may be related to the fact that isomerization yields are smaller for this (UV) excitation than for the S1 (n pi*, visible-light) excitation.