  Let $K$ be a number field and $S$ a set of primes of $K$. We write $K_S/K$
for the maximal extension of $K$ unramified outside $S$ and $G_{K,S}$ for its
Galois group. In this paper, we prove the following generalization of the
Neukirch-Uchida theorem under some assumptions: "For $i=1,2$, let $K_i$ be a
number field and $S_i$ a set of primes of $K_i$. If $G_{K_1,S_1}$ and
$G_{K_2,S_2}$ are isomorphic, then $K_1$ and $K_2$ are isomorphic." Here the
main assumption is that the Dirichlet density of $S_i$ is not zero for at least
one $i$. A key step of the proof is to recover group-theoretically the $l$-adic
cyclotomic character of an open subgroup of $G_{K,S}$ for some prime number
$l$.
