A long and intense γ-ray burst (GRB) was detected by INTEGRAL on 11 July 2012 with a duration of ~115 s and fluence of 2.8 × 10-4 erg cm-2 in the 20 keV−8 MeV energy range. GRB 120711A was at z ~ 1.405 and produced soft γ-ray emission (>20 keV) for at least ~10 ks after the trigger. The GRB was observed by several ground-based telescopes that detected a powerful optical flash peaking at an R-band brightness of ~11.5 mag at ~126 s after the trigger, or ~9th magnitude when corrected for the host galaxy extinction (AV ~ 0.85). The X-ray afterglow was monitored by the Swift, XMM-Newton, and Chandra observatories from 8 ks to 7 Ms and provides evidence for a jet break at ~0.9 Ms. We present a comprehensive temporal and spectral analysis of the long-lasting soft γ-ray emission detected in the 20−200 keV band with INTEGRAL/IBIS, the Fermi/LAT post-GRB detection above 100 MeV, the soft X-ray afterglow and the optical/near-infrared detections from Watcher, Skynet/PROMPT, GROND, and REM. The prompt emission had a very hard spectrum (Epeak ~ 1 MeV) and yields an Eγ,iso ~ 1054 erg (1 keV−10 MeV rest frame), making GRB 120711A one of the most energetic GRBs detected so far. We modelled the long-lasting soft γ-ray emission using the standard afterglow scenario, which indicates a forward shock origin. The combination of data extending from the near-infrared to GeV energies suggest that the emission is produced by a broken power-law spectrum consistent with synchrotron radiation. The afterglow is well modelled using a stratified wind-like environment with a density profile k ~ 1.2, suggesting a massive star progenitor (i.e. Wolf-Rayet) with a mass-loss rate between ~10-5−10-6 M⊙ yr-1 depending on the value of the radiative efficiency (ηγ = 0.2 or 0.5). The analysis of the reverse and forward shock emission reveals an initial Lorentz factor of ~120−340, a jet half-opening angle of ~2°−5°, and a baryon load of ~10-5 − 10-6 M⊙ consistent with the expectations of the fireball model when the emission is highly relativistic. Long-lasting soft γ-ray emission from other INTEGRAL GRBs with high peak fluxes, such as GRB 041219A, was not detected, suggesting that a combination of high Lorentz factor, emission above 100 MeV, and possibly a powerful reverse shock are required. Similar long-lasting soft γ-ray emission has recently been observed from the nearby and extremely bright Fermi/LAT burst GRB 130427A.