We consider a simple model describing a closed bosonic string in a con
stant magnetic field. Exact conformal invariance demands also the pres
ence of a non-trivial metric and antisymmetric tenser (induced by the
magnetic field). The model is invariant under target space duality in
a compact Kaluza-Klein direction introduced to couple the magnetic fie
ld. Like open string theory in a constant gauge field, or closed strin
g theory on a torus, this model can be straightforwardly quantised and
solved with its spectrum of states and partition function explicitly
computed. Above some critical value of the magnetic field an infinite
number of states become tachyonic, suggesting a presence of phase tran
sition. We also construct heterotic string generalisations of this bos
onic model in which the constant magnetic field is embedded either in
the Kaluza-Klein or internal gauge group sector.