  Local galaxies are broadly divided into two main classes, star-forming
(gas-rich) and quiescent (passive and gas-poor). The primary mechanism
responsible for quenching star formation in galaxies and transforming them into
quiescent and passive systems is still unclear. Sudden removal of gas through
outflows or stripping is one of the mechanisms often proposed. An alternative
mechanism is so-called "strangulation", in which the supply of cold gas to the
galaxy is halted. Here we report that the difference between quiescent and star
forming galaxies in terms of stellar metallicity (i.e. the fraction of metals
heavier than helium in stellar atmospheres) can be used to discriminate
efficiently between the two mechanisms. The analysis of the stellar metallicity
in local galaxies, from 26,000 spectra, clearly reveals that strangulation is
the primary mechanism responsible for quenching star formation, with a typical
timescale of 4 billion years, at least for local galaxies with a stellar mass
less than 10^11 solar masses. This result is further supported independently by
the stellar age difference between quiescent and star-forming galaxies, which
indicates that quiescent galaxies of less than 10^11 solar masses are on
average observed four billion years after quenching due to strangulation.
