Aims. We present a new three-dimensional radiation hydrodynamics code called HERACLES that uses an original moment method to solve the radiative transfer. Methods. The radiation transfer is modelled using a two-moment model and a closure relation that allows large angular anisotropies in the radiation field to be preserved and reproduced. The radiative equations thus obtained are solved by a second-order Godunov-type method and integrated implicitly by using iterative solvers. HERACLES has been parallelized with the MPI library and implemented in Cartesian, cylindrical, and spherical coordinates. To characterize the accuracy of HERACLES and to compare it with other codes, we performed a series of tests including purely radiative tests and radiation-hydrodynamics ones.Results. The results show that the physical model used in HERACLES for the transfer is fairly accurate in both the diffusion and transport limit, but also for semi-transparent regions.Conclusions. This makes HERACLES very well-suited to studying many astrophysical problems such as radiative shocks, molecular jets of young stars, fragmentation and formation of dense cores in the interstellar medium, and protoplanetary discs.