A multireference perturbation method is formulated, that uses an optimized partitioning. The zeroth-order energies are chosen in a way that guarantees vanishing the first neglected term in the perturbational ansatz for the wave function, Ψ(n) = 0. This procedure yields a family of zeroth-order Hamiltonians that allows for systematic control of errors arising from truncating the perturbative expansion of the wave function. The second-order version of the proposed method, denoted as MROPT(2), is shown to be (almost) size-consistent. The slight extensivity violation is shown numerically. The total energies obtained with MROPT(2) are similar to these obtained using the multireference configuration interaction method with Davidson-type corrections. We discuss connections of the MROPT(2) method to related approaches, the optimized partitioning introduced by Szabados and Surjan and the linearized multireference coupled-cluster method. The MROPT(2) method requires using state-optimized orbitals; we show on example of N2 that using Hartree–Fock orbitals for some excited states may lead to nonphysical results.