Dark energy cosmology is considered in a modified Gauss-Bonnet model of gravity with and without a scalar field. It is shown that these generalizations of general relativity endow it with a very rich cosmological structure: it may naturally lead to an effective cosmological constant, quintessence or phantom cosmic acceleration, with the possibility of describing the transition from a decelerating to an accelerating phase explicitly. It is demonstrated here that these modified GB and scalar-GB theories are perfectly viable as cosmological models. They can describe the ΛCDM cosmological era without any need for a cosmological constant. The specific properties of these theories of gravity in different particular cases, such as the de Sitter one, are studied. © 2010 IOP Publishing Ltd.