  Non-linear electrodynamics coupled to general relativity is investigated. In
general relativity, it is observed that the expansion of the universe is
accelerating if the source of the gravitational field is the non-linear
electromagnetic field. Moreover, a pure magnetic universe is explored. As a
result, it is demonstrated that the magnetic field drives the cosmic expansion
to be accelerated. Furthermore, the stability analysis of the present model is
developed. In addition, the energy conditions and future singularities are
studied in detail.
