We investigate theoretically the interface between a ferroelectric BaTiO 3 film and a non-polar insulating SrTiO 3 substrate. We find that thin BaTiO 3 (under 5 nm) can stabilize a non-polarized state, and an additional metastable polarized state. While the non-polarized state is insulating, for the polarized heterostructure, we discover the existence of two-dimensional charge carrier gases. In this case, the heterostructure undergoes an electronic reconstruction in order to prevent the polar catastrophe. The two-dimensional gases, formed as a result, screen the polarization, leading to a substantially reduced potential drop across the ferroelectric film. We emphasize that the twodimensional electron and hole gases are created by the polarization of the sample, and are not due to polar nature of the material or to doping.