ST-segment elevation myocardial infarction (STEMI) is the most severe type of heart attack, and primary percutaneous coronary intervention (PCI) is the first line treatment for STEMI. However, these patients are at higher risk of contrast-induced nephropathy (CIN), which increases the length of hospital stay and mortality rate. Anisodamine, an alkaloid extracted from a Chinese herb, has been shown to exert protective effects on the renal function. The aim of this study was to investigate the protective effect of anisodamine on CIN in STEMI patients undergoing primary PCI. A total of 126 consecutive STEMI patients were randomly assigned to receive anisodamine (n = 60) or placebo (control, n = 66) from admission to 24 hours after PCI. The serum creatinine (SCr) concentrations, estimated glomerular filtration rate (eGFR) and incidence of CIN were measured on admission, and 24, 48 and 72 hours after PCI between the two groups. We found that the renal function of all patients after PCI underwent a course from injury to recovery. The incidence of CIN was 5.0%, 8.3%, and 6.7% at 24, 48 and 72 hours, respectively, after primary PCI in anisodamine group, while in control group it was 16.7%, 22.7%, and 19.7%, respectively. The incidence of CIN in anisodamine group was lower than that in control group during 72 hours after PCI (all P < 0.05). In conclusion, intravenous infusion of anisodamine before and after primary PCI may reduce the occurrence of CIN in STEMI patients undergoing primary PCI, without serious side effects.