Ab initio nonadiabatic dynamics simulations of cis-to-trans isomerization of azobenzene upon S 1 (n-π*) excitation are carried out employing the fewest-switches surface hopping method. Azobenzene photoisomerization occurs purely as a rotational motion of the central CNNC moiety. Two nonequivalent rotational pathways corresponding to clockwise or counterclockwise rotation are available. The course of the rotational motion is strongly dependent on the initial conditions. The internal conversion occurs via an S 0/S 1 crossing seam located near the midpoint of both of these rotational pathways. Based on statistical analysis, it is shown that the occurrence of one or other pathway can be completely controlled by selecting adequate initial conditions.