With the advent of new wide-field, high-cadence optical transient surveys, our understanding of the diversity of core-collapse supernovae has grown tremendously in the last decade. However, the pre-supernova evolution of massive stars, that sets the physical backdrop to these violent events, is theoretically not well understood and difficult to probe observationally. Here we report the discovery of the supernova iPTF13dqy = SN 2013fs, a mere ~3 hr after explosion. Our rapid follow-up observations, which include multiwavelength photometry and extremely early (beginning at ~6 hr post-explosion) spectra, map the distribution of material in the immediate environment (<~ 10^15 cm) of the exploding star and establish that it was surrounded by circumstellar material (CSM) that was ejected during the final ~1 yr prior to explosion at a high rate, around 10^-3 solar masses per year. The complete disappearance of flash-ionised emission lines within the first several days requires that the dense CSM be confined to within <~ 10^15 cm, consistent with radio non-detections at 70--100 days. The observations indicate that iPTF13dqy was a regular Type II SN; thus, the finding that the probable red supergiant (RSG) progenitor of this common explosion ejected material at a highly elevated rate just prior to its demise suggests that pre-supernova instabilities may be common among exploding massive stars.