CsPbBr3 perovskite is highly desired to fabricate many optoelectronic devices: high photovoltage solar cells, tandem solar cells, light-emitting diodes, lasers, photodetectors, field effect transistors etc. However, to realize these applications, resistance to humidity, one of the most important stressing agents, needs to be understood. In this article, we investigate the effect of prolonged exposure (up to 500 h) of CsPbBr3 to approximate to 60% and 80% relative humidity by in situ X-ray diffraction and ex situ scanning electron microscopy, UV-visible spectroscopy and photoluminescence. We show that humidity does not always have detrimental effects. Indeed, the exposure of CsPbBr3 films to humidity for a limited time (2-3 days and 8 minutes for 60% and 80% RH, respectively) enhances their crystallinity. However, prolonged exposure to humidity results in partial degradation of the perovskite phase leading to the concomitant formation of a new, possibly hydrate, crystalline phase. Restoration of 30% RH leads to partial recovery of the initial phase by nucleation of new small CsPbBr3 crystallites. The present findings suggest that post-deposition treatment under controlled humidity might help in producing better films to enhance the efficiency of optoelectronic devices.