Due to light-induced effects in CH3NH3-based perovskites, such as ion migration, defects formation, and halide segregation, the degradation of CH3NH3-based perovskite solar cells under maximum power point is generally implicated. Here we demonstrated that the effect of light-enhanced ion migration in CH3NH3PbI3 can be eliminated by inorganic Cs substitution, leading to an ultrastable perovskite solar cell. Quantitatively, the ion migration barrier for CH3NH3PbI3 is 0.62 eV under dark conditions, larger than that of CsPbI2Br (0.45 eV); however, it reduces to 0.07 eV for CH3NH3PbI3 under illumination, smaller than that for CsPbI2Br (0.43 eV). Meanwhile, photoinduced halide segregation is also suppressed in Cs-based perovskites. Cs-based perovskite solar cells retained >99% of the initial efficiency (10.3%) after 1500 h of maximum power point tracking under AM1.5G illumination, while CH3NH3PbI3 solar cells degraded severely after 50 h of operation. Our work reveals an uncovered mechanism for stability improvement by inorganic cation substitution in perovskite-based optoelectronic devices.