Flexible broadband optoelectronic devices play a prominent role in the areas of daily life including wearable optoelectronic systems, health care, and bio-imaging systems. Two-dimensional (2D) narrow-bandgap materials with atomic thickness, adjustable bandgap, mechanical flexibility, as well as excellent optical and electrical properties exhibit great potential for applications in flexible optoelectronic devices. Here, we demonstrate a high-performance photodetector based on high-quality ternary Ta2NiSe5 nanosheets with a narrow bandgap of 0.25 eV. The photodetectors exhibit broadband photodetection capability in the visible-infrared spectrum (405~2200 nm) at room temperature. The maximum values of responsivity can reach up to 280 A W-1 at the wavelength of 405 nm. Meanwhile, the high responsivity of 63.9 A W-1 and detectivity of 3.8 × 109 Jonesare achieved at the wavelength of 2200 nm, respectively. In addition, the obtained Ta2NiSe5-based photodetector shows excellent flexibility and the photodetection performance is almost insignificantly degraded after 1000 bending cycles. These results indicate that the 2D Ta2NiSe5 semiconductor has great potential in future wearable infrared optoelectronic devices.