The discovery of superconductivity in the Ba-La-Cu-O system (the cuprate) in the 30 K range marked a significant breakthrough, which inspired extensive exploration of oxide-based, layered superconductors to identify electron pairing with higher critical temperatures (Tc)1. Despite recent observations of superconductivity in nickel oxide-based compounds (the nickelates), evidence of Cooper pairing above 30 K in a system that is isostructural to the cuprates, but without copper, at ambient pressure and without lattice compression has remained elusive2–5. Here we report superconductivity with a Tc approaching 40 K under ambient pressure in d9−x hole-doped, late rare earth, infinite-layer nickel oxide (Sm-Eu-Ca-Sr)NiO2 thin films with negligible lattice compression, supported by observations of a zero-resistance state at 31 K and the Meissner effect. The material can be synthesized with essentially no Ruddlesden–Popper-type structural defects, exhibiting ultralow resistivity of approximately 0.01 mΩ cm, and with a residual resistivity ratio of up to 10. Our findings demonstrate the potential for achieving high-temperature superconductivity using strongly correlated d-electron metal oxides beyond copper as the building blocks for superconductivity, and offering a promising platform for further exploration and understanding of high-temperature Cooper pairing.