Low-band-gap metal halide perovskite semiconductor based on mixed Sn/Pb is a key component to realize high-efficiency tandem perovskite solar cells. However, the mixed perovskites are unstable in air due to the oxidation of Sn2+. To overcome the stability problem, we introduced N-(3-aminopropyl)-2-pyrrolidinone into the CH3NH3Sn0.5Pb0.5IxCl3-x thin film. The carbonyl group on the molecule interacts with Sn2+/Pb2+ by Lewis acid coordination, forming vertically oriented 2D layered perovskite. The 2D phase is seamlessly connected to the bulk perovskite crystal, with a lattice coherently extending across the two phases. Based on this 2D/3D hybrid structure, we assembled low-band-gap Sn-based perovskite solar cells with power conversion efficiency greater than 12%. The best device was among the most stable Sn-based organic-inorganic hybrid perovskite solar cells to date, keeping 90% of its initial performance at ambient condition without encapsulation, and more than 70% under continuous illumination in an N2-filled glovebox for over 1 month.