Results from the Kepler mission indicate that the occurrence rate of small planets ($<3$ $R_oplus$) in the habitable zone of nearby low-mass stars may be as high as 80%. Despite this abundance, probing the conditions and atmospheric properties on any habitable-zone planet is extremely difficult and has remained elusive to date. Here, we report the detection of water vapor and the likely presence of liquid and icy water clouds in the atmosphere of the $2.6$ $R_oplus$ habitable-zone planet K2-18b. The simultaneous detection of water vapor and clouds in the mid-atmosphere of K2-18b is particularly intriguing because K2-18b receives virtually the same amount of total insolation from its host star ($1368_{-107}^{+114}$ W m$^{-2}$) as the Earth receives from the Sun (1361 W m$^{-2}$), resulting in the right conditions for water vapor to condense and explain the detected clouds. In this study, we observed nine transits of K2-18b using HST/WFC3 in order to achieve the necessary sensitivity to detect the water vapor, and we supplement this data set with Spitzer and K2 observations to obtain a broader wavelength coverage. While the thick hydrogen-dominated envelope we detect on K2-18b means that the planet is not a true Earth analog, our observations demonstrate that low-mass habitable-zone planets with the right conditions for liquid water are accessible with state-of-the-art telescopes.