We propose a new mechanism for obtaining de Sitter vacua in type IIB string theory compactified on (orientifolded) Calabi-Yau manifolds similar to those recently studied by Kachru, Kallosh, Linde and Trivedi (KKLT). dS vacuum appears in KKLT model after uplifting an AdS vacuum by adding an anti-D3-brane, which explicitly breaks supersymmetry. We accomplish the same goal by adding fluxes of gauge fields within the D7-branes, which induce a D-term potential in the effective 4D action. In this way we obtain dS space as a spontaneously broken vacuum from a purely supersymmetric 4D action. We argue that our approach can be directly extended to heterotic string vacua, with the dilaton potential obtained from a combination of gaugino condensation and the D-terms generated by anomalous U(1) gauge groups.