We study a C∗-dynamical system arising from the ring inclusion of the 2×2 integer matrices in the rational ones. The orientation preserving affine groups of these rings form a Hecke pair that is closely related to a recent construction of Connes and Marcolli; our dynamical system consists of the associated reduced Hecke C∗-algebra endowed with a canonical dynamics defined in terms of the determinant function. We show that the Schlichting completion also consists of affine groups of matrices, over the finite adeles, and we obtain results about the structure and induced representations of the Hecke C∗-algebra. In a somewhat unexpected parallel with the one dimensional case studied by Bost and Connes, there is a group of symmetries given by an action of the finite integral ideles, and the corresponding fixed point algebra decomposes as a tensor product over the primes. This decomposition allows us to obtain a complete description of a natural class of equilibrium states which conjecturally includes all KMSβ-states for β≠0,1.