We aimed to assess the risk factors and outcome of ventricular fibrillation (VF) before and during primary percutaneous coronary intervention (PPCI) in patients with ST-segment elevation myocardial infarction. From 1999 to 2012, we consecutively enrolled 5,373 patients with ST-segment elevation myocardial infarction. In total, 410 of the patients had VF before and 88 had VF during PPCI. During a mean follow-up of 4.2 years, 1,196 subjects died. A logistic regression model identified younger age, anterior infarct, Killip class >I at admission, and a preprocedural Thrombolysis In Myocardial Infarction flow grade of 0 to I to be significantly associated with VF before PPCI, whereas inferior infarct, a preprocedural Thrombolysis In Myocardial Infarction flow grade of 0 to I, and Killip class >I at admission were significantly associated with VF during PPCI. All-cause mortality was evaluated using the Cox regression model. Compared with the patients without VF, those with VF before or during PPCI had a significantly increased 30-day mortality, with an adjusted hazard ratio = 3.40 (95% confidence interval 1.70 to 6.70) and 4.20 (95% confidence interval 1.30 to 13.30), respectively. Importantly, there was no tendency of 30-day mortality difference between VF before and during PPCI (p = 0.170). In patients with VF before or during PPCI who survived for at least 30 days, there was no increase in the long-term mortality. In conclusion, our data suggest that 30-day mortality is the same for patients with VF before PPCI compared with VF during PPCI, and the occurrence of VF before or during PPCI was associated with increased 30-day mortality but not with long-term mortality.