Narrow-bandgap III-V semiconductor nanowires (NWs) with a suitable band structure and strong light-trapping ability are ideal for high-efficiency low-cost solar water-splitting systems. However, due to their nanoscale dimension, they suffer more severe corrosion by the electrolyte solution than the thin-film counterparts. Thus, short-term durability is the major obstacle for using these NWs for practical water splitting applications. Here, we demonstrated for the first time that a thin layer (~7 nm thick) of compact TiO$_2$ deposited by atomic layer deposition can provide robust protection to III-V NWs. The protected GaAs NWs maintain 91.4% of its photoluminescence intensity after 14 months of storage in ambient atmosphere, which suggests the TiO$_2$ layer is pinhole-free. Working as a photocathode for water splitting, they exhibited a 45% larger photocurrent density compared with un-protected counterparts and a high Faraday efficiency of 91%, and can also maintain a record-long highly-stable performance among narrow-bandgap III-V NW photoelectrodes; after 67 hours photoelectrochemical stability test reaction in strong acid electrolyte solution (pH = 1), they show no apparent indication of corrosion, which is in stark contrast to the un-protected NWs that are fully failed after 35-hours. These findings provide an effective way to enhance both stability and performance of III-V NW based photoelectrodes, which are highly important for practical applications in solar-energy-based water splitting systems.