The energy density and the pressure of SU(3) gauge theory at finite temperature are studied by direct lattice measurements of the renormalized energy-momentum tensor obtained by the gradient flow. Numerical analyses are carried out with β = 6.287-7.500 corresponding to the lattice spacing a = 0.013-0.061 fm. The spatial (temporal) sizes are chosen to be Ns = 64, 96, 128 (Nτ = 12,16,20,22,24) with the aspect ratio, 5.33 ≤ Ns/Nτ ≤ 8. Double extrapolation, a → 0 (the continuum limit) followed by t → 0 (the zero flow-time limit), is taken using the numerical data. Above the critical temperature, the thermodynamic quantities are obtained with a few percent precision including statistical and systematic errors. The results are in good agreement with previous high-precision data obtained by using the integral method.