  In a series of papers we have been studying the geometric theta
correspondence for non-compact arithmetic quotients of symmetric spaces
associated to orthogonal groups. It is our overall goal to develop a general
theory of geometric theta liftings in the context of the real differential
geometry/topology of non-compact locally symmetric spaces of orthogonal and
unitary groups which generalizes the theory of Kudla-Millson in the compact
case. In this paper we study in detail the geometric theta lift for Hilbert
modular surfaces. In particular, we will give a new proof and an extension (to
all finite index subgroups of the Hilbert modular group) of the celebrated
theorem of Hirzebruch and Zagier that the generating function for the
intersection numbers of the Hirzebruch-Zagier cycles is a classical modular
form of weight 2. In our approach we replace Hirzebuch's smooth complex
analytic compactification $\tilde{X}$ of the Hilbert modular surface $X$ with
the (real) Borel-Serre compactification $\bar{X}$. The various
algebro-geometric quantities are then replaced by topological quantities
associated to 4-manifolds with boundary. In particular, the "boundary
contribution" in Hirzebruch-Zagier is replaced by sums of linking numbers of
circles (the boundaries of the cycles) in the 3-manifolds of type Sol (torus
bundle over a circle) which comprise the Borel-Serre boundary.
