**Abstract** : Anosov representations were introduced by F. Labourie [18] for fundamental groups of closed negatively curved surfaces, and generalized by O. Guichard and A. Wienhard [19] to representations of arbitrary Gromov hyperbolic groups into real semisimple Lie groups. In this paper, we focus on Anosov representations into the identity component O0(2, n) of O(2, n) for n ≥ 2. Our main result is that any Anosov representation with negative limit set as defined in [8] is the holonomy group of a spatially compact, globally hyperbolic maximal (abbrev. CGHM) conformally flat spacetime. The proof of the spatial compactness needs a particular care. The key idea is to notice that for any spacetime M , the space of lightlike geodesics of M is homeomorphic to the unit tangent bundle of a Cauchy hypersurface of M. For this purpose, we introduce the space of causal geodesics containing timelike and lightlike geodesics of anti-de Sitter space and lightlike geodesics of its conformal boundary: the Einstein spacetime. The spatial compactness is a consequence of the following theorem : Any Anosov representation acts properly discontinuously by isometries on the set of causal geodesics avoiding the limit set; besides, this action is cocompact. It is stated in a general setting by O. Guichard, F. Kassel and A. Wienhard in [11]. We can see this last result as a Lorentzian analogue of the action of convex cocompact Kleinian group on the complementary of the limit set in H n. Lastly, we show that the conformally flat spacetime in our main result is the union of two conformal copies of a strongly causal AdS-spacetime with boundary which contains-when the limit set is not a topological (n − 1)-sphere-a globally hyperbolic region having the properties of a black hole as defined in [2], [3], [4].