Abstract Background and aims The atherogenic index of plasma (AIP) has been confirmed as a contributor of cardiovascular disease. But few evidence on the longitudinal pattern of AIP during follow-up. This study aimed to explore the associations between baseline and long-term AIP with the risk of myocardial infarction (MI). Methods A total of 98 861 participants without MI at baseline were included from the Kailuan study. The baseline AIP was calculated as log (triglyceride/high-density lipoprotein cholesterol). The long-term AIP was calculated as the updated mean AIP and the number of visits with high AIP. The updated mean AIP was calculated as the mean of AIP from baseline to the first occurrence of MI or to the end of follow-up. The number of visits with high AIP was defined as higher than the cutoff value at the first three visits. Univariable and multivariable Cox proportional hazard models were used to determine the association between AIP and the risk of MI. Results During a median follow-up of 12.80 years, 1804 participants developed MI. The multivariable models revealed that elevated levels of baseline and updated mean AIP increased the risk of MI, compared with quartile 1 the HR in quartile 4 was 1.63 (95% CI, 1.41-1.88) and 1.59 (95% CI, 1.37-1.83), respectively. Compared to those without high AIP, the risk of individuals with three times was 1.94 (95% CI,1.55-2.45). Conclusions Elevated levels of both baseline and long-term AIP displayed a higher risk of MI.