  The extended gaussian ensemble (EGE) is introduced as a generalization of the
canonical ensemble. The new ensemble is a further extension of the Gaussian
ensemble introduced by J. H. Hetherington [J. Low Temp. Phys. {\bf 66}, 145
(1987)]. The statistical mechanical formalism is derived both from the analysis
of the system attached to a finite reservoir and from the Maximum Statistical
Entropy Principle. The probability of each microstate depends on two parameters
$\beta$ and $\gamma$ which allow to fix, independently, the mean energy of the
system and the energy fluctuations respectively. We establish the Legendre
transform structure for the generalized thermodynamic potential and propose a
stability criterion. We also compare the EGE probability distribution with the
$q$-exponential distribution. As an example, an application to a system with
few independent spins is presented.
