We have investigated the variation of magnetic helicity over a span of several days around the times of 11 X-class flares which occurred in seven active regions ( NOAA 9672 , 10030 , 10314 , 10486 , 10564 , 10696 , and 10720 ) using the magnetograms taken by the Michelson Doppler Imager ( MDI ) on board the Solar and Heliospheric Observatory ( SOHO ) . As a major result we found that each of these major flares was preceded by a significant helicity accumulation , ( 1.8–16 ) \times 10 ^ { 42 } Mx ^ { 2 } over a long period ( 0.5 to a few days ) . Another finding is that the helicity accumulates at a nearly constant rate , ( 4.5–48 ) \times 10 ^ { 40 } Mx ^ { 2 } hr ^ { -1 } , and then becomes nearly constant before the flares . This led us to distinguish the helicity variation into two phases : a phase of monotonically increasing helicity and the following phase of relatively constant helicity . As expected , the amount of helicity accumulated shows a modest correlation with time-integrated soft X-ray flux during flares . However , the average helicity change rate in the first phase shows even stronger correlation with the time-integrated soft X-ray flux . We discuss the physical implications of this result and the possibility that this characteristic helicity variation pattern can be used as an early warning sign for solar eruptions .