Aims. We study the response of the solar atmosphere during a GOES M1.6 flare using spectroscopic and imaging observations. In particular, we examine the evolution of the mass flows and electron density together with the energy input derived from hard X-ray (HXR) in the context of chromospheric evaporation.Methods. We analyzed high-cadence sit-and-stare observations acquired with the Hinode/EIS spectrometer in the Fe xiii 202.044 Å (log T = 6.2) and Fe xvi 262.980 Å (log T = 6.4) spectral lines to derive temporal variations of the line intensity, Doppler shifts, and electron density during the flare. We combined these data with HXR measurements acquired with RHESSI to derive the energy input to the lower atmosphere by flare-accelerated electrons.Results. During the flare impulsive phase, we observe no significant flows in the cooler Fe xiii line but strong upflows, up to 80-150 km s −1 , in the hotter Fe xvi line. The largest Doppler shifts observed in the Fe xvi line were co-temporal with the sharp intensity peak. The electron density obtained from a Fe xiii line pair ratio exhibited fast increase (within two minutes) from the pre-flare level of 5.01 × 10 9 cm −3 to 3.16 × 10 10 cm −3 during the flare peak. The nonthermal energy flux density deposited from the coronal acceleration site to the lower atmospheric layers during the flare peak was found to be 1.34 × 10 10 erg s −1 cm −2 for a low-energy cut-off that was estimated to be 16 keV. During the decline flare phase, we found a secondary intensity and density peak of lower amplitude that was preceded by upflows of ∼15 km s −1 that were detected in both lines. The flare was also accompanied by a filament eruption that was partly captured by the EIS observations. We derived Doppler velocities of 250-300 km s −1 for the upflowing filament material. Conclusions. The spectroscopic results for the flare peak are consistent with the scenario of explosive chromospheric evaporation, although a comparatively low value of the nonthermal energy flux density was determined for this phase of the flare. This outcome is discussed in the context of recent hydrodynamic simulations. It provides observational evidence that the response of the atmospheric plasma strongly depends on the properties of the electron beams responsible for the heating, in particular the steepness of the energy distribution. The secondary peak of line intensity and electron density detected during the decline phase is interpreted as a signature of flare loops being filled by expanding hot material that is due to chromospheric evaporation.