  Let $F$ be a totally real field of degree $n$ and $p$ an odd prime. We prove
the $p$-part of the integral Gross-Stark conjecture for the Brumer-Stark
$p$-units living in CM abelian extensions of $F$. In previous work, the first
author showed that such a result implies an exact $p$-adic analytic formula for
these Brumer-Stark units up to a bounded root of unity error, including a "real
multiplication" analogue of Shimura's celebrated reciprocity law in the theory
of Complex Multiplication. In this paper we show that the Brumer-Stark units,
along with $n-1$ other easily described elements (these are simply square roots
of certain elements of $F$) generate the maximal abelian extension of $F$. We
therefore obtain an unconditional solution to Hilbert's 12th problem for
totally real fields, albeit one that involves $p$-adic integration, for
infinitely many primes $p$.
  Our method of proof of the integral Gross-Stark conjecture is a
generalization of our previous work on the Brumer-Stark conjecture. We apply
Ribet's method in the context of group ring valued Hilbert modular forms. A key
new construction here is the definition of a Galois module
$\nabla_{\!\mathscr{L}}$ that incorporates an integral version of the
Greenberg-Stevens $\mathscr{L}$-invariant into the theory of Ritter-Weiss
modules. This allows for the reinterpretation of Gross's conjecture as the
vanishing of the Fitting ideal of $\nabla_{\!\mathscr{L}}$. This vanishing is
obtained by constructing a quotient of $\nabla_{\!\mathscr{L}}$ whose Fitting
ideal vanishes using the Galois representations associated to cuspidal Hilbert
modular forms.
