Recently, Pollack and Shevelev [‘On perfect and near-perfect numbers’, J. Number Theory 132 (2012), 3037–3046] introduced the concept of near-perfect numbers. A positive integer $n$ is called near-perfect if it is the sum of all but one of its proper divisors. In this paper, we determine all near-perfect numbers with two distinct prime factors.