More than three thousand exoplanets have been detected so far, and more and more spectroscopic observations of exoplanets are performed. Future instruments (JWST, E-ELT, PLATO, Ariel, . . . ) are eagerly awaited as they will be able to provide spectroscopic data with a greater accuracy and sensitivity than what is currently available. This will allow more accurate conclusions to be drawn on the chemistry and dynamics of the exoplanet atmospheres, on condition that the observational data are processed carefully. An important aspect to consider is temporal stellar atmospheric disturbances that can influence the planetary composition, and hence spectra, and potentially can lead to incorrect assumptions about the steady-state atmospheric composition of the planet. In this paper, we focus on perturbations that come from the host star in the form of flare events that significantly increase the photon flux impingement on the exoplanets atmosphere. In some cases, and particularly for M stars, this sudden increase may last for several hours. We aim at answering the question to what extent a stellar flare is able to modify the chemical composition of the planetary atmosphere and, therefore influence the resulting spectra. We use a one-dimensional thermo-photochemical model to study the neutral atmospheric composition of two hypothetic planets located around the star AD Leo. We place the two planets at different distances from the star, which results in effective atmospheric temperatures of 412 K and 1303 K. AD Leo is an active star that has already been observed during a flare. We therefore use the spectroscopic data from this flare event to simulate the evolution of the chemical composition of the atmospheres of the two hypothetic planets. We compute synthetic spectra to evaluate the implications for observations. The increase of the incoming photon flux affects the chemical abundances of some important species (such as H and NH 3 ) down to altitudes associated with an atmospheric pressure of 1 bar, that can lead to variations in planetary spectra (up to 150 ppm) if performed during transit. We find that each exoplanet has a post-flare steady-state composition that is significantly different from the preflare steady-state. We predict that these variations could be detectable with both current and future spectroscopic instruments if sufficiently high signal-to-noise spectra are obtained.