(Abridged) The ESO Slice Project (ESP) is a galaxy redshift survey we have completed as an ESO Key-Project over ~23 square degrees, in a region near the South Galactic Pole. The survey is nearly complete to the limiting magnitude b_J=19.4 and consists of 3342 galaxies with reliable redshift determination. The ESP survey is intermediate between shallow, wide angle samples and very deep, one-dimensional pencil beams: spanning a volume of ~ 5 x 10^4 Mpc^3 at the sensitivity peak (z ~ 0.1), it provides an accurate determination of the local luminosity function and the mean galaxy density. We find that, although a Schechter function is an acceptable representation of the luminosity function over the entire range of magnitudes (M < -12.4), our data suggest the presence of a steepening of the luminosity function for M > -17. The amplitude and the alpha and M^* parameters of our luminosity function are in good agreement with those of the AUTOFIB redshift survey (Ellis et al. 1996). Viceversa, our amplitude is significantly higher, by a factor ~ 1.6 at M ~ M^*, than that found for both the Stromlo-APM (Loveday et al. 1992) and the Las Campanas (Lin et al. 1996) redshift surveys. Also the faint end slope of our luminosity function is significantly steeper than that found in these two surveys. Large over- and under- densities are clearly seen in our data. In particular, we find evidence for a local underdensity (for D < 140 Mpc) and a significant overdensity at z ~ 0.1. When these radial density variations are taken into account, our derived luminosity function reproduces very well the observed counts for b_J < 19.4, including the steeper than Euclidean slope for b_J < 17.