Photons carry linear momentum, and spin angular momentum when circularly or elliptically polarized. During light-matter interaction, transfer of linear momentum leads to optical forces, while angular momentum transfer induces optical torque. Optical forces including radiation pressure and gradient forces have long been utilized in optical tweezers and laser cooling. In nanophotonic devices optical forces can be significantly enhanced, leading to unprecedented optomechanical effects in both classical and quantum regimes. In contrast, to date, the angular momentum of light and the optical torque effect remain unexplored in integrated photonics. Here, we demonstrate the measurement of the spin angular momentum of photons propagating in a birefringent waveguide and the use of optical torque to actuate rotational motion of an optomechanical device. We show that the sign and magnitude of the optical torque are determined by the photon polarization states that are synthesized on the chip. Our study reveals the mechanical effect of photon’s polarization degree of freedom and demonstrates its control in integrated photonic devices. Exploiting optical torque and optomechanical interaction with photon angular momentum can lead to torsional cavity optomechanics and optomechanical photon spin-orbit coupling, as well as applications such as optomechanical gyroscope and torsional magnetometry.