In this paper we continue the programme of topologically twisting N = 2 theories in D = 4, focusing on the coupling of vector multiplets to N = 2 supergravity. We show that in the minimal case, namely when the special geometry prepotential F( X) is a quadratic polynomial, the theory has a so far unknown on-shell U(1) symmetry, that we name R-duality. R-duality is a generalization of the chiral-dual on-shell symmetry of N = 2 pure supergravity and of the R-symmetry of N = 2 super Yang-Mills theory. Thanks to this, the theory can be topologically twisted and topologically shifted, precisely as pure N = 2 supergravity, to yield a natural coupling of topological gravity to topological Yang-Mills theory. The gauge-fixing condition that emerges from the twisting is the self-duality condition on the gauge field strength and on the spin connection. Hence our theory reduces to intersection theory in the moduli-space of gauge instantons living in gravitational instanton backgrounds. We remark that, for deep properties of the parent N = 2 theory, the topological Yang-Mills theory we obtain by taking the flat space limit of our gravity-coupled lagrangian is different from the Donaldson theory constructed by Witten. Whether this difference is substantial and what its geometrical implications may be is yet to be seen. We also discuss the topological twist of the hypermultiplets leading to topological quaternionic sigma-models. The instantons of these models, named by us hyperinstantons, corespond to a notion of triholomorphic mappings discussed in the paper. In all cases the new ghost number is the sum of the old ghost number plus the R-duality charge. The observables described by the theory are briefly discussed. In conclusion, the topological twist of the complete N = 2 theory defines intersection theory in the moduli-space of gauge instantons plus gravitational instantons plus hyperinstantons. This is possibly a new subject for further mathematical investigation.