First, we consider a semilinear hyperbolic equation with a locally distributed damping in a boundeddomain. The damping is located on a neighborhood of a suitable portion of theboundary. Using a Carleman estimate [Duyckaerts, Zhang and Zuazua, Ann. Inst. H. Poincaré Anal. Non Linéaire (to appear); Fu, Yong and Zhang, SIAM J. Contr. Opt.46 (2007) 1578–1614], we prove that the energy of this system decays exponentially to zero as the time variable goes to infinity. Second, relying on another Carleman estimate [Ruiz, J. Math. Pures Appl.71 (1992) 455–467], we address the same type of problem in an exterior domain for a locally damped semilinear wave equation. For both problems, our method of proof is constructive, and much simpler than those found in the literature. In particular, we improve in some way on earlier results by Dafermos, Haraux, Nakao, Slemrod and Zuazua.