Localizing and quantifying the sources of ElectroEncephaloGraphy (EEG) and MagnetoEncephaloGraphy (MEG) measurements is an ill-posed inverse problem, whose solution requires a spatial regularization involving both anatomical and functional priors. The distributed source model enables the introduction of such constraints. However, the resulting solution is unstable since the equation system one has to solve is badly conditioned and under-determined. We propose an original approach for solving the inverse problem, that allows to deal with a better-determined system and to temper the influence of priors according to their consistency with the measured EEG/MEG data. This Localization Estimation Algorithm (LEA) estimates the amplitude of a selected subset of sources, which are localized based on a prior distribution of activation probability. LEA is evaluated through numerical simulations and compared to a classical Weighted Minimum Norm estimation.