  We describe a construction which associates to any function field $k$ and any
place $\infty$ of $k$ a $C^*$-dynamical system $(C_{k,\infty},\sigma_t)$ that
is analogous to the Bost-Connes system associated to $\QQ$ and its archimedian
place. Our construction relies on Hayes' explicit class field theory in terms
of sign-normalized rank one Drinfel'd modules. We show that $C_{k,\infty}$ has
a faithful continuous action of $\Gal(K/k)$, where $K$ is a certain field
constructed by Hayes, such that $k^\abi\subset K\subset k^\ab$, where $k^\abi$
is the maximal abelian extension of $k$ that is totally split at $\infty$. We
classify the extremal KMS$_\beta$ states of $(C_{k,\infty},\sigma_t)$ at any
temperature $0<1/\beta<\infty$ and show that a phase transition with
spontaneous symmetry breaking occurs at temperature $1/\beta=1$. At high
temperature $1/\beta\geqslant 1$, there is a unique KMS$_\beta$ state. At low
temperature $1/\beta<1$, the space of extremal KMS$_\beta$ states is principal
homogeneous under $\Gal(K/k)$. Each such state is of type $\I_\infty$ and the
partition function is the Dedekind zeta function $\zeta_{k,\infty}$. Moreover,
we construct a "rational" *-subalgebra $\HH$, we give a presentation of $\HH$
and of $C_{k,\infty}$, and we show that the values of the low-temperature
extremal KMS$_\beta$ states at certain elements of $\HH$ are related to special
values of partial zeta functions.\n
  Erratum: This article wrongly claims that at high temperature
$1/\beta\geqslant 1$, the unique KMS$_\beta$ state is of type
$\III_{q^{-\beta}}$, where $q$ is the cardinal of the constant subfield of $k$.
It has been shown by Neshveyev and Rustad \cite{NesRus12} that the correct type
is $\III_{q^{-\beta d_\infty}}$ where $d_\infty$ is the degree of the place
$\infty$. The original statements have been kept for reference, but errata have
been inserted next to them.
