I am considering the following two isomorphisms:


First, if $X$ is a reasonably nice topological space, then $X$ has a normal covering space which is maximal with respect to the property of having an abelian group of deck transformations. The group of deck transformations of this covering space is isomorphic to the abelianizatin of the fundamental group of $X$, which can be identified with the singular homology group $H\_1(X,\mathbb{Z})$.


Second, if $K$ is a number field, class field theory gives an isomorphism between the Galois group of the maximal abelian unramified extension of $K$ (the Hilbert class field) and the ideal class group of $K$. The ideal class group can be identified with the sheaf cohomology group $H^1(\mathrm{Spec}(\mathcal{O}\_K),\mathbf{G}\_m)$.


Given the apparent similarity between these two theorems, is there some more general theorem which implies both of these results as special cases?



Connection between isomorphisms of algebraic topology and class field theory
As BCnrd says, the theorem you want is geometric class field theory. One version says that the abelianization of the fundamental group of a curve over an algebraically closed field is the fundamental group of its Jacobian. One can use this to derive class field theory for curves over finite fields. Over the complex numbers, this is a topological statement, since the Jacobian of a Riemann surface can be constructed by topological methods, such as $J(C)=H\_1(C;\mathbb R/\mathbb Z)$. Also, consider Weil's construction of the Jacobian by using Riemann-Roch to recognize a high symmetric power of a curve as a $\mathbb C\mathbb P^n$ bundle over the Jacobian. The projective space bundle is probably not a topological invariant, but the symmetric power is and it already has the right fundamental group. That has an extensive topological generalization, the [Dold-Thom theorem](https://ncatlab.org/nlab/show/Dold-Thom+theorem), that the homology of a reasonable space is the homotopy groups of its infinite symmetric power.


The key unifying ingredient is, as BCnrd says, the Jacobian, even though it is missing from both of your statements.


