We give a construction of a nuclear _C_∗-algebra associated with an amalgamated free product of groups, generalizing Spielberg’s construction of a certain Cuntz–Krieger algebra associated with a ﬁnitely generated free product of cyclic groups. Our nuclear _C_∗-algebras can be identiﬁed with certain Cuntz–Krieger–Pimsner algebras. We will also show that our algebras can be obtained by the crossed product construction of the canonical actions on the hyperbolic boundaries, which proves a special case of Adams’ result about amenability of the boundary action for hyperbolic groups. We will also give an explicit formula of the K-groups of our algebras. Finally we will investigate a relationship between the KMS states of the generalized gauge actions on our _C_∗-algebras and random walks on the groups.