The stellar initial mass function (IMF) describes the mass distribution of stars at the time of their formation and is of fundamental importance for many areas of astrophysics. The IMF is reasonably well constrained in the disk of the Milky Way but we have very little direct information on the form of the IMF in other galaxies and at earlier cosmic epochs. Here we report observations of the Na (I) doublet and the Wing-Ford molecular FeH band in the spectra of elliptical galaxies. These lines are strong in stars with masses less than 0.3M(⊙) (where M(⊙) is the mass of the Sun) and are weak or absent in all other types of stars. We unambiguously detect both signatures, consistent with previous studies that were based on data of lower signal-to-noise ratio. The direct detection of the light of low-mass stars implies that they are very abundant in elliptical galaxies, making up over 80% of the total number of stars and contributing more than 60% of the total stellar mass. We infer that the IMF in massive star-forming galaxies in the early Universe produced many more low-mass stars than the IMF in the Milky Way disk, and was probably slightly steeper than the Salpeter form in the mass range 0.1M(⊙) to 1M(⊙).