Photoisomerization mechanism of azobenzene in the lowest excited state S 1 ͑n ء ͒ is investigated by ab initio molecular dynamics ͑AIMD͒ simulation with the RATTLE algorithm, based on the state-averaged complete active space self-consistent field method. AIMD simulations show that cis to trans isomerization occurs via two-step rotation mechanism, accompanying rotations of the central NN part and two phenyl rings, and this process can be classified into two types, namely, clockwise and counterclockwise rotation pathways. On the other hand, trans to cis isomerization occurs via conventional rotation pathway where two phenyl rings rotate around the NN bond. The quantum yields are calculated to be 0.45 and 0.28Ϯ 0.14 for cis to trans and trans to cis photoisomerizations, respectively, which are in very good agreement with the corresponding experimental results.