We construct compact examples of D-manifolds for type IIB strings. The construction has a natural interpretation in terms of compactification of a 12 dimensional `F-theory'. We provide evidence for a more natural reformulation of type IIB theory in terms of F-theory. Compactification of M-theory on a manifold \(K\) which admits elliptic fibration is equivalent to compactification of F-theory on \(K\times S^1\). A large class of \(N=1\) theories in 6 dimensions are obtained by compactification of F-theory on Calabi-Yau threefolds. A class of phenomenologically promising compactifications of F-theory is on \(Spin(7)\) holonomy manifolds down to 4 dimensions. This may provide a concrete realization of Witten's proposal for solving the cosmological constant problem in four dimensions.