We define an invariant, which we call surface-complexity, of closed 3-manifolds by means of Dehn surfaces. The surface-complexity of a manifold is a natural number measuring how much the manifold is complicated. We prove that it fulfils interesting properties: it is subadditive under connected sum and finite-to-one on P2-irreducible manifolds. Moreover, for P2-irreducible manifolds, it equals the minimal number of cubes in a cubulation of the manifold, except for the sphere S3, the projective space RP3 and the lens space L41, which have surface-complexity zero. We will also give estimations of the surface-complexity by means of triangulations, Heegaard splittings, surgery presentations and Matveev complexity.