  We answer a question of Margolis from 1997 by establishing that the maximal
subgroup of the minimal ideal of a finitely generated free profinite monoid is
a free profinite group. More generally if $\mathbf H$ is variety of finite
groups closed under extension and containing $\mathbb Z/p\mathbb Z$ for
infinitely may primes $p$, the corresponding result holds for free
pro-$\bar{\mathbf H}$ monoids.
