We study the origin of unresolved X-ray emission from the bulge of M31 based on archival Chandra and XMM-Newton observations. We demonstrate that three different components are present: (i) Broad-band emission from a large number of faint sources -- mainly accreting white dwarfs and active binaries, associated with the old stellar population, similar to the Galactic Ridge X-ray emission of the Milky Way. The X-ray to K-band luminosity ratios are compatible with those for the Milky Way and for M32, in the 2 - 10 keV band it is (3.6 +/- 0.2) x 10^27 erg/s/L_sun. (ii) Soft emission from ionized gas with temperature of about ~ 300 eV and mass of ~ 2 x 10^6 M_sun. The gas distribution is significantly extended along the minor axis of the galaxy suggesting that it may be outflowing in the direction perpendicular to the galactic disk. The mass and energy supply from evolved stars and type Ia supernovae is sufficient to sustain the outflow. We also detect a shadow cast on the gas emission by spiral arms and the 10-kpc star-forming ring, confirming significant extent of the gas in the ``vertical direction. (iii) Hard extended emission from spiral arms, most likely associated with young stellar objects and young stars located in the star-forming regions. The L_X/SFR ratio equals ~ 9 x 10^38 (erg/s)/(M_sun/yr) which is about ~ 1/3 of the HMXBs contribution, determined earlier from Chandra observations of other nearby galaxies.