The problem of classical diffusion in a random medium is mapped into a quantum mechanical problem with a disordered potential, and the dependence of the localization properties of the ground state wave function on the space dimensionality is analyzed. An extended ground state is obtained for D > 2, while anomalous localization occurs for D < 2. At the critical dimensionality D = 2 the ground state wave function exhibits algebraic localization.