We explore a new kind of field of nonlinear electrodynamics ( NLED ) which acts as a source of gravity and can accelerate the universe during the inflationary era . We propose a new type of NLED lagrangian which is charecterized by two paremetrs \alpha and \beta . We investigate the classical stability and causality aspects of this model by demanding that the speed ( C _ { s } = \frac { dP } { d \rho } ) of the sound wave C _ { s } ^ { 2 } > 0 and C _ { s } \leq 1 and find that 0 < C _ { s } ^ { 2 } < 1 corresponds to 0.25 \leq \alpha \leq 0.4 and 0.6 \leq \beta B ^ { 2 } \leq 1 . A study of the deceleration parameter ( q = \frac { 1 } { 2 } ( 1 + 3 \omega ) , \omega = P / \rho being the equation of state parameter ) suggests that the value q < 0 ( i.e . \omega < -1 / 3 and \ddot { a } ( t ) > 0 ( the accelerating universe ) ) requires \beta B ^ { 2 } \geq 0.13 . During inflation , the energy density \rho _ { B } is found to be maximum and is given by \rho _ { B } ^ { max } = 0.65 / \beta corresponding to \alpha = 0.3 . The magnetic field necessary to trigger the inflation , is found to be B ( = B _ { max } ) \simeq \sqrt { \frac { 0.4 \rho _ { B } ^ { max } } { 0.65 } } = 4 \times 10 ^ { 51 } ~ { } { Gauss } , where \rho _ { B } ^ { max } ( = 10 ^ { 64 } ~ { } { GeV } ^ { 4 } ) is the energy density of the universe during inflation . The model also predict the e-fold number N = 71 , which agrees with the experimental result .