In this paper we prove that for a nonuniformly hyperbolic system (f, (Lambda) over tilde) and for every nonempty, compact and connected subset K with the same hyperbolic rate in the space M-inv((Lambda) over tilde, f) of invariant measures on (Lambda) over tilde, the metric entropy and the topological entropy of basin G(K) are related by the variational equality inf{h(mu)(f) | mu epsilon K} = h(top)(f, G(K)). In particular, for every invariant (usually nonergodic) measure mu epsilon M-inv((Lambda) over tilde, f), we have h(mu)(f) - h(top)(f, G(mu)). We also verify that M-inv((Lambda) over tilde, f) contains an open domain in the space of ergodic measures for diffeomorphisms with some hyperbolicity. As an application, the historical ...