  The perturbative spectrum of BPS-states in the E_8 x E_8 heterotic string
theory compactified on T^2 is analysed. We show that the space of BPS-states
forms a representation of a certain Borcherds algebra G which we construct
explicitly using an auxiliary conformal field theory. The denominator formula
of an extension G_{ext} \supset G of this algebra is then found to appear in a
certain heterotic one-loop N=4 topological string amplitude. Our construction
thus gives an N=4 realisation of the idea envisioned by Harvey and Moore,
namely that the `algebra of BPS-states' controls the threshold corrections in
the heterotic string.
