The purpose of this paper is to provide a new characterization of Cohen-Macaulay local rings. As a consequence we deduce that a local (Noetherian) ring R is Gorenstein if and only if every parameter ideal of R is irreducible.