We report on a 40 ks long, uninterrupted X-ray observation of the candidate supergiant fast X-ray transient (SFXT) IGR J16418−4532 performed with XMM–Newton on 2011 February 23. This high-mass X-ray binary lies in the direction of the Norma arm, at an estimated distance of 13 kpc. During the observation, the source showed strong variability exceeding two orders of magnitudes, never observed before from this source. Its X-ray flux varied in the range from ∼0.1 to 15 counts s−1, with several bright flares of different durations (from a few hundred to a few thousand seconds) and sometimes with a quasi-periodic behaviour. This finding supports the previous suggestion that IGR J16418−4532 is a member of the SFXT class. In our new observation we measured a pulse period of 1212 ± 6 s, thus confirming that this binary contains a slowly rotating neutron star. During the periods of low luminosity the source spectrum is softer and more absorbed than during the flares. A soft excess is present below 2 keV in the cumulative flare spectrum, possibly due to ionized wind material at a distance similar to the neutron star accretion radius. The kind of X-ray variability displayed by IGR J16418−4532, its dynamic range and time-scale, together with the sporadic presence of quasi-periodic flaring, are all suggestive of a transitional accretion regime between pure wind accretion and full Roche lobe overflow. We discuss here for the first time this hypothesis to explain the behaviour of IGR J16418−4532 and, possibly, of other SFXTs with short orbital periods.