The Maxwell extension of the affine algebra in four dimensions with additional tensor generator is given. Using the methods of nonlinear realizations, we find the transformation rules for the group parameters and the corresponding generators. Gauging the Maxwell-affine algebra we present two possible invariant actions for gravity: one is first order and the other one is second order in the affine curvature. We notice that equations of motion for the action, second order in the affine curvature, lead to the generalized Bianchi identities on the choice of appropriate coefficients for a particular solution of the constraint equation. (C) 2015 The Authors. Published by Elsevier B.V.