  We consider N =1 compactifications to four dimensions of heterotic string
theory in the presence of fluxes. We show that up to order O(\alpha'^2) the
associated action can be written as a sum of squares of BPS-like quantities. In
this way we prove that the equations of motion are solved by backgrounds which
fulfill the supersymmetry conditions and the Bianchi identities. We also argue
for the expression of the related superpotential and discuss the radial modulus
stabilization for a class of examples.
