We suggest a mechanical model describing buckling of a tectonic plate due to non-stationary longitudinal wave of compression that propagates along the plate. For low frequencies the interaction of a tectonic plate with its environment can be approximately described by means of the Winkler elastic foundation. Introducing the inhomogeneous Winkler foundation with weakened zone can lead to the existence of trapped modes of transversal oscillation in this mechanical system, and makes possible the localized buckling of the plate. Such an instability can be considered as a possible reason of an earthquake. To study this mechanism of an earthquake, we suggest a coupled model that can describe both transversal and longitudinal motions of a tectonic plate.