As the physical properties of ABX(3) perovskite-based oxides strongly depend on the geometry of oxygen octahedra containing transition-metal cations, precise identification of the distortion, tilt, and rotation of the octahedra is an essential step toward understanding the structure-property correlation. Here we discover an important electrostatic origin responsible for remarkable Jahn-Teller-type tetragonal distortion of oxygen octahedra during atomic-level direct observation of two-dimensional [AX] interleaved shear faults in five different perovskite-type materials, SrTiO3, BaCeO3, LaCoO3, LaNiO3, and CsPbBr3. When the [AX] sublayer has a net charge, for example [LaO](+) in LaCoO3 and LaNiO3, substantial tetragonal elongation of oxygen octahedra at the fault plane is observed and this screens the strong repulsion between the consecutive [LaO](+) layers. Moreover, our findings on the distortion induced by local charge are identified to be a general structural feature in lanthanide-based A(n + 1)B(n)X(3n + 1)-type Ruddlesden-Popper (RP) oxides with charged [LnO](+) (Ln = La, Pr, Nd, Eu, and Gd) sublayers, among more than 80 RP oxides and halides with high symmetry. The present study thus demonstrates that the local uneven electrostatics is a crucial factor significantly affecting the crystal structure of complex oxides. The authors observe two-dimensional shear faults in five different perovskite-type materials and detailed structures of more than 80 oxides and halides to elucidate an electrostatic origin for Jahn-Teller-type tetragonal distortion of oxygen octahedra.