  We derive a new set of field equations within the framework of the Palatini
formalism.These equations are a natural generalization of the Einstein-Maxwell
equations which arise by adding a function $\mathcal{F}(\mathcal{Q})$, with
$\mathcal{Q}\equiv F^{\alpha\beta}F_{\alpha\beta}$ to the Palatini Lagrangian
$f(R,Q)$.The result we obtain can be viewed as the coupling of gravity with a
nonlinear extension of the electromagnetic field.In addition,a new method is
introduced to solve the algebraic equation associated to the Ricci tensor.
