The localization of wave functions in real space is known to be extremely helpful in the investigation of the electronic properties and in the development of O(N) methods. However, maximally localized wave functions in real space do not provide a good representation of the Bloch orbitals of a metallic system, where the localization procedure is very inefficient and of little use. On the other hand, in metals, it appears more natural to localize the wave functions in reciprocal space. In this work we propose a spread functional, which needs to be minimized in order to obtain maximally localized wave functions in reciprocal space and illustrate an efficient iterative minimization procedure. We also discuss the application of the method to some metallic systems and demonstrate that in this case the localized wave functions have features that can be useful for the analysis of electronic properties.