Constructing three-dimensional (3D)/two-dimensional (2D) hybrid perovskite heterojunction has been proved to be a promising approach to improve the power conversion efficiency (PCE) and environmental stability of perovskite solar cells (PSCs). Here, an organic ammonium salt, cyclohexylmethylammonium bromide (CMABr), is deposited atop the primary 3D perovskite film to form ultrathin 2D perovskite with residual PbI2 between the light-absorbing layer and the hole transport layer (HTL). The in-situ wide-band-gap 2D perovskite layer could play a multifunctional role in passivating the surface defects and protecting the underlying 3D perovskite film from humidity, resulting in the significantly suppressed non-radiative recombination process and superior moisture stability. As a result, a maximum PCE of 21.80% was obtained for the 3D/2D PSC as compared to that (19.62%) of pure 3D device. Moreover, the unencapsulated devices with 2D perovskite capping layer exhibited excellent long-term durability and mitigated hysteresis in contrast with the control device. Our study confirms that building 3D/2D perovskite heterojunctions by the utilization of organic ammonium salts is an effective way to develop highly efficient and stable PSCs.