We introduce a new class of commutative nonnoetherian rings, called n-subperfect rings, generalizing the almost perfect rings that have been studied recently by Fuchs and Salce. For an integer n >= 0, the ring R is said to be n-subperfect if every maximal regular sequence in R has length n and the total ring of quotients of R/I for any ideal I generated by a regular sequence is a perfect ring in the sense of Bass. We define an extended Cohen- Macaulay ring as a commutative ring R that has noetherian prime spectrum and each localization R-M at a maximal ideal M is ht(M)-subperfect. In the noetherian case, these are precisely the classical Cohen-Macaulay rings. Several relevant properties are proved reminiscent of those shared by Cohen-Macaulay rings.