We prove that, under suitable restrictions, an idempotent monad t defi
ned on a full subcategory A of a category C can be extended to an idem
potent monad T on C in a universal (terminal) way. Our result applies
in particular to the case when t is P-localization of nilpotent groups
(where P denotes a set of primes) and C is the category of all groups
. The corresponding monad Ton C is, in a certain precise sense, the be
st idempotent approximation to the usual Z(p)-completion of groups; it
turns out to be a strict epimorphic image of Bousfield's HZ(p)-locali
zation.