evidence: The Sun exhibits centennial-scale activity variations and sometimes encounters grand solar minimum when solar activity becomes extremely weak and sunspots disappear for several decades. Such an extreme weakening of solar activity could cause severe climate, causing massive reductions in crop yields in some regions. During the past decade, the Sun’s activity has tended to decline, raising concerns that the Sun might be heading for the next grand minimum. However, we still have an underdeveloped understanding of solar dynamo mechanisms and hence precise prediction of near-future solar activity is not attained. Here we show that the 11-year solar cycles were significantly lengthened before the onset of the Maunder Minimum (1645–1715 CE) based on unprecedentedly high-precision data of carbon-14 content in tree rings. It implies that flow speed in the convection zone is an essential parameter to determine long-term solar activity variations. We find that a 16 year-long cycle had occurred three solar cycles before the onset of prolonged sunspot disappearance, suggesting a longer-than-expected preparatory period for the grand minimum. As the Sun has shown a tendency of cycle lengthening since Solar Cycle 23 (1996–2008 CE), the behavior of Solar Cycle 25 can be critically important to the later solar activity.