Abstract. In this article we study the hydrostatic equilibrium configuration of neutron stars and strange stars, whose fluid pressure is computed from the equations of state p = ωρ 5/3 and p = 0.28(ρ − 4B), respectively, with ω and B being constants and ρ the energy density of the fluid. We start by deriving the hydrostatic equilibrium equation for the f (R, T ) theory of gravity, with R and T standing for the Ricci scalar and trace of the energy-momentum tensor, respectively. Such an equation is a generalization of the one obtained from general relativity, and the latter can be retrieved for a certain limit of the theory. For the f (R, T ) = R + 2λT functional form, with λ being a constant, we find that some physical properties of the stars, such as pressure, energy density, mass and radius, are affected when λ is changed. We show that for a fixed central star energy density, the mass of neutron and strange stars can increase with λ. Concerning the star radius, it increases for neutron stars and it decreases for strange stars with the increment of λ. Thus, in f (R, T ) theory of gravity we can push the maximum mass above the observational limits. This implies that the equation of state cannot be eliminated if the maximum mass within General Relativity lies below the limit given by observed pulsars.arXiv:1511.06282v2 [gr-qc]