A previous study, with relatively small number of patients, showed that prior Mycobacterium tuberculosis (TB) may precipitate SLE in patients from endemic areas. The purpose of the study was to investigate the relationship between prior TB infection and systemic lupus erythematosus (SLE) from the National Health Insurance Research Database (NHIRD) in Taiwan. Cases of SLE and TB were identified from the NHIRD with corresponding ICD-9 codes 710.0 and 011-018, respectively, from January 2000 to December 2008. A total of 2,721 cases of SLE and 10,823 control subjects were included in data analysis. The average annual incidence rate was 8.1 per 100,000. The annual incidence rates of SLE decreased from 6.38 per 100,000 to 2.55 per 100,000 during 2000-2008. Compared with the control subjects, SLE patients were more likely to be white collar workers (P = 0.0005), reside in highly urbanized areas (P = 0.0140), and have higher incomes (P = 0.0088). TB was much more prevalent in SLE patients than in the control subjects (1.8 vs. 0.9%, P < 0.001). The mean time interval between diagnosis of TB and SLE was 45.58 ± 39.0 months. On multivariate analysis, TB was the greatest potential risk factor for precipitating SLE (OR = 2.11, 95% CI = 1.49-3.00). In addition, patients with co-existing TB and DM had a higher risk of SLE than the control group (OR = 3.91, 95% CI 1.84-8.31). In conclusion, this study suggests that there is an increased risk of precipitating SLE among patients with TB in Taiwan from a nationwide health insurance research dataset. Mycobacterial infections could trigger autoimmune diseases in experimental studies. Furthermore, a study with relatively small number of patients revealed that prior TB may precipitate SLE in patients from endemic areas. There is an increased risk of precipitating SLE among patients with TB in Taiwan from a nationwide health insurance research dataset during a 9-year period.