In the past few years, the efficiency of solar cells based on hybrid organic–inorganic perovskites has exceeded the level needed for commercialization. However, existing perovskites solar cells (PSCs) suffer from several intrinsic instabilities, which prevent them from reaching industrial maturity, and stabilizing PSCs has become a critically important problem. Here we propose to stabilize PSCs chemically by strengthening the interactions between the organic cation and inorganic anion of the perovskite framework. In particular, we show that replacing the methylammonium cation with alternative protonated cations allows an increase in the stability of the perovskite by forming strong hydrogen bonds with the halide anions. This interaction also provides opportunities for tuning the electronic states near the bandgap. These mechanisms should have a universal character in different hybrid organic–inorganic framework materials that are widely used.