We compute the KMS (equilibrium) states for the canonical time evolution on C*-algebras from actions of congruence monoids on rings of algebraic integers. We show that for each β ∈ [1, 2], there is a unique KMS β state, and we prove that it is a factor state of type III1. There is a phase transition at β = 2: For each β ∈ (2, ∞], the set of extremal KMS β states decomposes as a disjoint union over a quotient of a ray class group in which the fibers are extremal traces on certain group C*-algebras associated with the ideal classes. Moreover, in most cases, there is a further phase transition at β = ∞ in the sense that there are ground states that are not KMS∞ states. Our computation of KMS and ground states generalizes the results of Cuntz, Deninger, and Laca for the full ax + b-semigroup over a ring of integers, and our type classification generalizes a result of Laca and Neshveyev in the case of the rational numbers and a result of Neshveyev in the case of arbitrary number fields.