We consider the extension of the general-linear and special-linear algebras by employing the Maxwell symmetry in D space-time dimensions. We show how various Maxwell extensions of the ordinary space-time algebras can be obtained by a suitable contraction of generalized algebras. The extended Lie algebras could be useful in the construction of generalized gravity theories and the objects that couple to them. We also consider the gravitational dynamics of these algebras in the framework of the gauge theories of gravity. By adopting the symmetry-breaking mechanism of the Stelle–West model, we present some modified gravity models that contain the generalized cosmological constant term in four dimensions.