  Let $R$ be a commutative noetherian ring, and $\mathcal{Z}$ a stable under
specialization subset of $\Spec(R)$. We introduce a notion of
$\mathcal{Z}$-cofiniteness and study its main properties. In the case
$\dim(\mathcal{Z})\leq 1$, or $\dim(R)\leq 2$, or $R$ is semilocal with
$\cd(\mathcal{Z},R) \leq 1$, we show that the category of
$\mathcal{Z}$-cofinite $R$-modules is abelian. Also, in each of these cases, we
prove that the local cohomology module $H^{i}_{\mathcal{Z}}(X)$ is
$\mathcal{Z}$-cofinite for every homologically left-bounded $R$-complex $X$
whose homology modules are finitely generated and every $i \in \mathbb{Z}$.
