To assess the role of atrial fibrillation (AF) on complicating inpatient outcomes of radical prostatectomy (RP). We identified patients treated with RP during 2012-2014 within National Inpatient Sample (NIS) database. Length of stay, cost of hospitalization, and in-hospital complications were compared between patients with or without diagnosis of AF. Propensity score matching methods and multivariable regression analysis were used to adjust for potential confounders and a trend analysis was conducted. Patients with AF had a significantly longer hospital stay (coefficient 0.19, 95% CI 0.09-0.29, P < 0.001) and higher cost (coefficient 0.10, 95% CI 0.06-0.15, P < 0.001). Post-operative cardiac complications were significantly higher for patients with AF (OR 16.38, 95% CI 7.72-34.74, P < 0.001), while no differences were found in other complications between the two groups. Similar results were shown in propensity score matching methods. The cardiac complications after laparoscopic RP (OR: 37.71, 95% CI 1.85-768.73, P = 0.018) and open RP (OR: 16.78, 95% CI 1.41-199.51, P = 0.026) were significantly higher than robot-assisted RP (RARP) in patients with AF. The results of trend study indicated that postoperative cardiac complication rates showed a trend of decreasing year by year while the prevalence of AF was rising. Perioperative AF is associated with increased cardiac complications, longer hospital stay and higher cost in PCa patients undergoing RP. RARP may be a preferred choice for patients with AF. Attention should be paid to this special patient population. Reasonable pre-operative risk stratification and standardized management should be done to decrease perioperative complications.