The closest known ultraluminous X-ray source (ULX), M33 X-8, has been recently observed with NuSTAR during its Extragalactic Legacy program, which includes a hard X-ray survey of the M33 galaxy. We present results of two long observations of M33 taken in 2017 March and July, with M33 X-8 in the field of view. The source demonstrates a nearly constant flux during the observations, and its 3-20 keV spectrum can be well described by two distinct components: a standard accretion disc with a temperature of ~1 keV at the inner radius and a power law with a photon index ~3, which is significantly detected up to 20 keV. There is also an indication of a high-energy cutoff in the spectrum, corresponding to a temperature of the Comptonizing medium of >10 keV. The broad-band spectral properties of M33 X-8 resemble black hole X-ray binaries in their very high states, suggesting that M33 X-8 is a black hole accreting at a nearly Eddington rate, in contrast to super-Eddington accretion believed to take place in more luminous ULXs.