We have made ROSAT Position Sensitive Proportional Counter (PSPC) and High Resolution Imager (HRI) X-ray observations to study the intracluster gas surrounding the powerful radio source Hercules A. The cluster is luminous in X-rays (L-bol = 4.8 X 10(37) W), although apparently poor in optical galaxies, and the host of the radio source is the central dominating galaxy of the cluster. The azimuthally averaged X-ray surface brightness profile is well fitted by a modified King (beta) model, with core radius r(c) = 121 +/- 10 kpc and beta = 0.74 +/- 0.03, but the cluster is elongated parallel to the radio source, especially on the scale of the radio lobes, and fits to individual quadrants give a core radius 50 per cent larger along the radio axis. Part of this elongation appears to be associated with enhanced X-ray emission superimposed on the outer radio lobes, which extend to just over 2r(c). There are no obvious depressions in the X-ray emission coincident with the radio lobes, as expected if the relativistic plasma displaces the intracluster medium (ICM). However, we show that these depressions may be quite weak, essentially because the main part of the lobes are outside the cluster core. From the surface brightness profile for the PSPC data the X-ray emission extends out to similar to2.2-Mpc radius. In the absence of the powerful jets (which must be a transient phenomenon on cosmological time-scales), we would expect a cooling flow at the centre of the cluster; but currently it must be substantially disturbed by the expansion of the radio lobes. The PSPC spectrum reveals a cool component of the ICM with 0.5 less than or similar to kT less than or similar to 1 keV in addition to the approximate to 4-keV component detected by ASCA and BeppoSAX. The central cooling time could be as low as 2 Gyr if the cool component is centrally concentrated, otherwise it is around 6 Gyr. Cooling is significant on a Hubble time to a radius of about 90 kpc. The modelled central electron density of n(0) = 1.0 x 10(4) m(-3) is typical for modest cooling flows. Finally, we have detected faint X-ray emission from a compact central source, with size < 15 kpc and luminosity approximate to 2 x 10(36) W.