Inverted perovskite solar cells have attracted increasing attention because they have achieved long operating lifetimes. However, they have exhibited significantly inferior power conversion efficiencies compared to regular perovskite solar cells. Here we reduce this efficiency gap using a trace amount of surface-anchoring alkylamine ligands (AALs) with different chain lengths as grain and interface modifiers. We show that long-chain AALs added to the precursor solution suppress nonradiative carrier recombination and improve the optoelectronic properties of mixed-cation mixed-halide perovskite films. The resulting AALs surface-modified films exhibit a prominent (100) orientation and lower trap-state density as well as enhanced carrier mobilities and diffusion lengths. These translate into a certified stabilized power conversion efficiency of 22.3% (23.0% power conversion efficiency for lab-measured champion devices). The devices operate for over 1,000h at the maximum power point under simulated AM1.5 illumination, without loss of efficiency.