We investigate the gravitational origin of the Tsallis entropy, characterized by the nonadditive index δ. Utilizing Wald's formalism within the framework of f(R) modified theories of gravity, we evaluate the entropy on the black hole horizon for constant curvature solutions to the spherically symmetric vacuum field equations. In so doing, we demonstrate that the Tsallis entropy can be effectively derived from a generalization of the Lagrangian L∝R1+ϵ, where ϵ=δ−1 quantifies small deviations from general relativity. In conclusion, we examine the physical implications of our findings in light of cosmological observations and elaborate on the possibility of solving the thermodynamic instability of Schwarzschild black holes.