We introduce a novel energy functional for ground-state electronic-structure calculations. Its fundamental variables are the natural spin-orbitals of the implied singlet many-body wave function and their joint occupation probabilities. The functional derives from a sequence of controlled approximations to the two-particle density matrix. Algebraic scaling of computational cost with electron number is obtainable in general, and Hartree-Fock scaling in the seniority-zero version of the theory. Results obtained with the latter version for saturated small molecular systems are compared with those of highly-accurate quantum-chemical computations. The numerical results are variational, capturing most of the correlation energy from equilibrium to dissociation. Their accuracy is considerably greater than that obtainable with current density-functional theory approximations and with current functionals of the one-particle density matrix only.