Context. It has been suggested that the well-studied giant HII regions M 16 and M 17 may have had a common origin, being an example of large-scale triggered star formation. While some features of the distribution of the interstellar medium in the region support this interpretation, no definitive detection of an earlier population of massive stars responsible for the triggering has been made thus far. Aims. We have carried out observations looking for red supergiants in the area covered by a giant shell seen in HI and CO centered on galactic coordinates l∼14.5°, b~+1° whose emission peaks near the same radial velocity as the bulk of the emission from both giant HII regions, which are located along the shell. Red supergiants have ages in the range expected for the parent association whose most massive members could have triggered the formation of the shell and of the giant HII regions along its rim. Methods. We have obtained spectroscopy in the visible of a sample of red stars selected on the basis of their infrared colors, whose magnitudes are consistent with them being red supergiants if they are located at the distance of M 16 and M 17. Spectroscopy is needed to distinguish red supergiants from AGB stars and RGB stars, which are expected to be abundant along the line of sight. Results. Out of a sample of 37 bright red stars, we identify four red supergiants that confirm the existence of massive stars in the age range between ∼10 and ∼30Myr in the area. At least three of them have Gaia DR2 parallaxes consistent with them being at the same distance as M 16 and M 17. Conclusions. The evidence of past massive star formation within the area of the gaseous shell lends support to the idea that it was formed by the combined action of stellar winds and ionizing radiation of the precursors of the current red supergiants. These could be the remnants of a richer population, whose most massive members have already exploded as core-collapse supernovae. The expansion of the shell against the surrounding medium, perhaps combined with the overrun of preexisting clouds, is thus a plausible trigger of the formation of a second generation of stars currently responsible for the ionization of M 16 and M 17.