We present late‐time near‐infrared (NIR) and optical observations of the Type IIn SN 1998S. The NIR photometry spans 333–1242 d after explosion, while the NIR and optical spectra cover 333–1191 and 305–1093 d, respectively. The NIR photometry extends to the M′ band (4.7 μm), making SN 1998S only the second ever supernova for which such a long IR wavelength has been detected. The shape and evolution of the Hα and He i 1.083‐μm line profiles indicate a powerful interaction with a progenitor wind, as well as providing evidence of dust condensation within the ejecta. The latest optical spectrum suggests that the wind had been flowing for at least 430 yr. The intensity and rise of the HK continuum towards longer wavelengths together with the relatively bright L′ and M′ magnitudes show that the NIR emission was due to hot dust newly formed in the ejecta and/or pre‐existing dust in the progenitor circumstellar medium (CSM). The NIR spectral energy distribution (SED) at about 1 yr is well described by a single‐temperature blackbody spectrum at about 1200 K. The temperature declines over subsequent epochs. After ∼2 yr, the blackbody matches are less successful, probably indicating an increasing range of temperatures in the emission regions. Fits to the SEDs achieved with blackbodies weighted with λ−1 or λ−2 emissivity are almost always less successful. Possible origins for the NIR emission are considered. Significant radioactive heating of ejecta dust is ruled out, as is shock/X‐ray‐precursor heating of CSM dust. More plausible sources are (a) an IR echo from CSM dust driven by the ultraviolet/optical peak luminosity, and (b) emission from newly‐condensed dust which formed within a cool, dense shell produced by the ejecta shock/CSM interaction. We argue that the evidence favours the condensing dust hypothesis, although an IR echo is not ruled out. Within the condensing‐dust scenario, the IR luminosity indicates the presence of at least 10−3 M⊙ of dust in the ejecta, and probably considerably more. Finally, we show that the late‐time (K–L′)0 evolution of Type II supernovae may provide a useful tool for determining the presence or absence of a massive CSM around their progenitor stars.