The virus increased risk of cancer and fluoroquinolones (FQs) could induce the interstitial lung disease (ILD) such as acute interstitial pneumonitis. The effects of FQs on the risk of cancer in patients having theILD concurrent with virus infection (ILD cohort) based on the International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9CM) is to be determined. The propensity score was calculated based on age, sex, index date, and medications of these comorbidities. Through the January 2000 to December 2013, the ILD cohort with FQs use (FQs cohort, N = 3,264) and those in the ILD cohort without FQs use (non-FQs cohort, N = 3,264) enter into study. Cox proportional regression with time-dependent exposure covariates was used to analyze the cumulative incidence of cancer. Adjusted hazard ratios (aHRs) and 95% confidence intervals (CIs) for cancer were determined after controlling for sex, age, medications (anti-inflammatory drugs, immunosuppressants), and comorbidities, as well as the use of FQs. Compared with the non-FQs cohort, the FQs cohort had aHRs (95% CIs) for cancer, colorectal cancer, lung cancer, and prostate cancer were 0.70 (0.59–0.83), 0.56 (0.37–0.85), 0.56 (0.38–0.85), and 2.39 (1.27–4.49) respectively. For patients with a single use of FQ>4≤ 15 days/ >15 days, the aHRs (95% CIs) were 0.50 (0.32–0.78)/1.83(0.71–4.70), 0.47 (0.31–0.73)/ 2.08 (0.97-4.48), and 1.94 (1.01–3.74)/ 12.1 (4.73–31.1) for colorectal, lung, and prostate cancers, respectively. The trend of the increase of the value of the aHR was found in these three cancers. For the patients with the cumulative daily dose FQ>4000mg ≤ 15 000mg/ >15 000mg, the similar trend was found also.Meanwhile, the use of FQs >4 ≤15 days (<cDDD, >4000mg ≤15000mg) was associated with a lower aHR for colorectal cancer and lung cancer in selected cases (drug sensitive). The use of the FQs >15 days(>cDDD15000 mg) was with a higher aHR for cancers such as prostate cancer (drug resistance). Perhaps, the FQs with drug sensitive for colorectal cancer and lung cancer may play an auxiliary role for prevention of these two cancers. Meanwhile, the FQs with drug resistance may not play a role for prevention of the prostate cancer. However, confounding factors such as drug resistance and a higher rate of medical services must be considered in the prostate cancer cohort.