Rotation of MO6 (M = transition metal) octahedra is a key determinant of the physical properties of perovskite materials. Therefore, tuning physical properties, one of the most important goals in condensed matter research, may be accomplished by controlling octahedral rotation (OR). In this study, it is demonstrated that OR can be driven by an electric field in Sr2RuO4. Rotated octahedra in the surface layer of Sr2RuO4 are restored to the unrotated bulk structure upon dosing the surface with K. Theoretical investigation shows that OR in Sr2RuO4 originates from the surface electric field, which can be tuned via the screening effect of the overlaid K layer. This work establishes not only that variation in the OR angle can be induced by an electric field, but also provides a way to control OR, which is an important step toward in situ control of the physical properties of perovskite oxides.