Abstract The relationship between magnetic clouds, cosmic ray decreases and geomagnetic storms has been investigated by using some cosmic ray hourly intensities recorded with ground-based monitors at Alert, Deep River and Mount Washington, as well as the geomagnetic activity Dst index, and the interplanetary magnetic field (IMF) and the solar wind plasma (SWP) bulk-speed, density and temperature in the near-Earth space, on 28–30 September 1978, 24–26 April 1979, 13–15 January 1967, 3–5 January 1978, and 27–29 November 1989. Due to the interplanetary coronal mass ejection (ICME) impacting on slow solar wind, there is a sheath upstream of the ICME led by a fast forward shock. And the large IMF variations in this sheath, which sustain the depressions in the cosmic ray intensity during Forbush decreases (FDs), were found not to influence the main phase storm, but rather the southward IMF in the said sheath and magnetic cloud was the major source in triggering geomagnetic storms, by allowing a strong coupling between the solar wind and the magnetosphere. It was also observed that the initial set of the main phase storm always began in the sheath where, and when, the sustained southward-oriented IMF first occurred, but ceased when the IMF was rotated to a strong northward-orientation, only to resume at subsequent sustained southward-oriented IMF within the sheath and the leading (i.e., front) region of the magnetic cloud. The front boundary of the magnetic cloud was found to be well defined by the relatively high (≳10 nT) rms of the IMF components, which prominently separates both the Lull region of the sheath and the onset of the second decrease of the two-step FD, from the magnetic cloud. There were some instances where a two-step main phase storm, caused by the combination of a sheath and cloud structure, occurred, the two steps sometimes both starting in the sheath itself. Also, in some cases, the sheath and the leading region of the magnetic cloud together produced a single-step storm. In addition, enhanced IMF south latitude and IMF intensity in the sheath and magnetic cloud during the IMF sustained southern orientation, were each observed to produce enhanced geomagnetic activity, even for intense storms. And high SWP bulk speed was found to reduce the depth of the Dst index. Therefore, it appears that when the magnetosphere is exposed to a sustained southward-oriented IMF in the magnetic cloud and the sheath preceding it, a valve (i.e., valve-like IMF direction) opens and allows direct transfer of energy between the solar wind and the magnetosphere to trigger the geomagnetic storms, such that the stronger the sustained IMF south-ward orientation, the wider the valve opens, the higher the SWP bulk speed, the narrower the opening in the valve becomes. And the more the IMF strength during the IMF southern orientation, the larger is the solar wind energy density that is available for transfer through the valve. The valve closes when the IMF is rotated to a strong northward-orientation, and the geomagnetic storms cease. Index terms: 2104 Interplanetary Physics: Cosmic rays; 2111 Interplanetary Physics: Ejecta, driver gases, and magnetic clouds; 2139 Interplanetary Physics: Interplanetary shocks; 7513 Solar Physics, Astrophysics, and Astronomy: Coronal mass ejections.