Broad-lined type Ic supernovae ( SNe Ic-BL ) are peculiar stellar explosions that distinguish themselves from ordinary SNe . Some SNe Ic-BL are associated with long-duration ( \gtrsim 2 \mathord { \thinspace s } ) gamma-ray bursts ( GRBs ) . Black holes and magnetars are two types of compact objects that are hypothesized to be central engines of GRBs . In spite of decades of investigations , no direct evidence for the formation of black holes or magnetars has been found for GRBs so far . Here we report the finding that the early peak ( t \lesssim 50 \mathord { \thinspace days } ) and late-time ( t \gtrsim 300 \mathord { \thinspace days } ) slow decay displayed in the light curves of both SNe 1998bw ( associated with GRB 980425 ) and 2002ap ( not GRB-associated ) can be attributed to magnetar spin-down with initial rotation period P _ { 0 } \sim 20 \mathord { \thinspace ms } , while the intermediate-time ( 50 \lesssim t \lesssim 300 \mathord { \thinspace days } ) exponential decline is caused by radioactive decay of ^ { 56 } Ni . The connection between the early peak and late-time slow decline in the light curves is unexpected in alternative models . We thus suggest that GRB 980425 and SN 2002ap were powered by magnetars .