We present triple-axis neutron scattering studies of low-energy magnetic fluctuations in strongly underdoped La2−xSrxCuO4 with x = 0.05, 0.06 and 0.07, providing quantitative evidence for a direct competition between these fluctuations and superconductivity. At dopings x = 0.06 and x = 0.07, three-dimensional superconductivity is found, while only a very weak signature of twodimensional superconductivity residing in the CuO2 planes is detectable for x = 0.05. We find a surprising suppression of the low-energy fluctuations by an external magnetic field at all three dopings. This implies that the response of two-dimensional superconductivity to a magnetic field is similar to that of a bulk superconductor. Our results provide direct evidence of a very gradual onset of superconductivity in cuprates.