In this work, we find by means of first principle calculations a new physical mechanism to generate a two dimensional electron gas, namely, the breaking of charge ordering at the surface of a charge ordered semiconductor due to the incomplete oxygen environment of the surface ions. The emergence of the 2D gas is independent of the presence of oxygen vacancies or polar discontinuities; this is a self-doping effect. This mechanism might apply to many charge ordered systems, in particular, we study the case of BaBiO3(001). In bulk, this material is a prototype of a forbidden valence compound in which the formal metallic Bi4+ state is skipped exhibiting a charge disproportionated Bi3+ - Bi5+ ordered structure. At room temperature, this charge disproportionation together with the breathing distortions gives rise to a Peierls semiconductor with monoclinic crystal structure. At higher temperature (T > 750 K) or upon doping, it turns cubic and metallic. Interestingly, doped BaBiO3 was one of the first non-cuprate high-Tc superconductors discovered. The outer layer of the Bi-terminated simulated surface turns more cubic- like and metallic while the inner layers remain in the insulating monoclinic state. On the other hand, the metallization does not occur for the Ba termination, a fact that makes this system appealing for nanostructuring. Finally, this finding sets another possible route for future exploration: the potential scenario of 2D superconductivity at the BaBiO3 surface.