The concept of heterogeneous surface impedance is introduced. This is defined as an impedance sheet whose surface impedance varies from point to point in an arbitrary manner. The approach is found yield useful results in a variety of physical situations, and a few applications are illustrated by numerical examples.Physical heterogeneous impedance sheets are extremely common. Typical examples are provided by resonators which are built up of several pieces of metals of various conductivities, resonators imperfectly assembled (e.g. by having small gaps between various parts), effects of imperfect machining or annealing, etc.The formulae developed relate the Q-factor and the resonant frequency of a cavity to its dimensions and the Fourier components the surface impedance function, which, in general, may be anisotropic. The analysis is kept as general as possible, and the formulae developed do not exclude any of the practical cases.In the case of circumferential heterogeneity it is shown that all E_{m, n, l}- and H_{m, n, l}-modes (other than E_{0}- and H_{0}-modes) are unstable unless the 2mth harmonic of the heterogeneous surface impedance is absent. It is further concluded that such cavities are characterized by double-humped resonance curve, but so far as the E_{0}- and H_{0}-modes are concerned, the cavity may be regarded as homogeneous with surface impedance equal to the mean value of the surface-impedance function.With the exception of a few isolated cases (discussed in detail) an axially heterogeneous cavity, when supporting any E_{m, n, l} or H_{m, n, l}-mode, may be regarded as a homogeneous one whose axial anisotropic component is the sum of the mean value of the surface-impedance function and one-half of its lth harmonic, and whose circumferential component is given by the difference between the mean value of the surface-impedance function and one-half of its lth harmonic.It is shown that, in general, a unique value of the surface impedance cannot be ascribed to an unbounded periodic sheet, but if its period is sufficiently small (in comparison with the wavelength), the heterogeneous sheet behaves as if it were homogeneous of surface impedance equal to the mean value of the surface-impedance function.