  We present deep optical and near-infrared imaging of the rich cluster A2218
at z=0.17. Our optical imaging comes from new multicolour Hubble Space
Telescope WFPC2 observations in the F450W (B), F606W (V) and F814W (I)
passbands. These observations are complemented by deep near-infrared, Ks-band,
imaging from the new INGRID imager on the 4.2-m William Herschel Telescope.
This combination provides unique high-precision multicolour optical-infrared
photometry and morphological information for a large sample of galaxies in the
core of this rich cluster at a lookback time of ~3Gyrs. We analyse the (B-I),
(V-I) and (I-Ks) colours of galaxies spanning a range of a factor of 100 in
K-band luminosity in this region and compare these with grids of stellar
population models. We find that the locus of the colours of the stellar
populations in the luminous (>0.5L*) early-type galaxies, both ellipticals and
S0s, traces a sequence of varying metallicity at a single age. At fainter
luminosities (<0.1L*), this sequence is extended to lower metallicities by the
morphologically-classified ellipticals. However, the faintest S0s exhibit very
different behaviour, showing a wide range in colours, including a large
fraction (30%) with relatively blue colours which appear to have younger
luminosity-weighted ages for their stellar populations, 2-5Gyrs. We show that
the proportion of these young S0s in the cluster population is consistent with
the observed decrease in the S0 population seen in distant clusters when
interpreted within the framework of a two-step spectroscopic and morphological
transformation of accreted spiral field galaxies into cluster S0s.
