We combine density-functional theory with density-matrix-functional theory to draw the best from both worlds. This is achieved by range separation of the electronic interaction which permits one to rigorously combine a short-range density functional with a long-range density-matrix functional. The short-range density functional is approximated by the short-range version of the Perdew-Burke-Ernzerhof functional (srPBE). The long-range density-matrix functional is approximated by the long-range version of the Buijse-Baerends functional (lrBB). The obtained srPBE$+$lrBB method accurately describes both the static and dynamic electron correlation at a computational cost similar to that of standard density-functional approximations. This is shown for the dissociation curves of the ${\mathrm{H}}_{2}$, LiH, BH, and HF molecules.