The evolution of magnetic activity in late-type stars is part of the intertwined rotation-age-activity relation which provides an empirical foundation to the theory of magnetic dynamos . We study the age-activity relation in the pre-main sequence ( PMS ) regime , for the first time using mass-stratified subsamples . The effort is based on the Chandra Orion Ultradeep Project ( COUP ) which provides very sensitive and homogenous X-ray data on a uniquely large sample of 481 optically well-characterized low-extinction low-mass members of the Orion Nebula Cluster , for which individual stellar masses and ages could be determined . More than 98 percent of the stars in this sample are detected as X-ray sources . Within the PMS phase for stellar ages in the range \sim 0.1 - 10 Myr , we establish a mild decay in activity with stellar age \tau roughly as L _ { X } \propto \tau ^ { -1 / 3 } . On longer timescales , when the Orion stars are compared to main sequence stars , the X-ray luminosity decay law for stars in the 0.5 < M < 1.2 M _ { \odot } mass range is more rapid with L _ { X } \propto \tau ^ { -0.75 } over the wide range of ages 5 < \log \tau < 9.5 yr . When the fractional X-ray luminosity L _ { X } / L _ { bol } and the X-ray surface flux are considered as activity indicators , the decay law index is similarly slow for the first 1 - 100 Myr but accelerates for older stars . The magnetic activity history for M stars with masses 0.1 < M < 0.4 ~ { } M _ { \odot } is distinctly different . Only a mild decrease in X-ray luminosity , and even a mild increase in L _ { X } / L _ { bol } and F _ { X } , is seen over the 1 - 100 Myr range , though the X-ray emission does decay over long timescales on the main sequence . Together with COUP results on the absence of a rotation-activity relation in Orion stars , we find that the activity-age decay is strong across the entire history of solar-type stars but is not attributable to rotational deceleration during the early epochs . A combination of tachocline and distributed convective dynamos may be operative in young solar-type stars . The results for the lowest mass stars are most easily understood by the dominance of convective dynamos during both the PMS and main sequence phases .