Authors: J.P.C.Greenlees and G.Lyubeznik ``Rings with a local cohomology theorem, and applications to group cohomology.'' 17 pp We study connected graded algebra over a field which satisfy a local cohomology theorem (such as the cohomology ring of a group which is a discrete or profinite virtual duality group or a compact Lie group). It is obvious that if such a ring is Cohen-Macaulay it is Gorenstein. We show that if it has depth one less than its dimension (ie is almost Cohen-Macaulay) then it is in fact almost Gorenstein, and its Hilbert series satisfies a pair of functional equations. This proves a conjecture of Greenlees and Benson for the cohomology of classifying spaces of compact Lie groups and virtual duality groups. We also prove a number of structural results. For example, minimal primes of local cohomology groups of cohomology rings of groups are shown to be Quillen strata. Status: Submitted for publication.