Abstract Background: Diabetes is associated with an increased risk of several cancers and overall mortality and cancer mortality. Previous studies have suggested that metformin use may decrease cancer mortality, though findings have been inconsistent. We examined metformin and other diabetes medication use and survival from breast, colorectal, lung, and gastric cancers with respect to timing of diabetes medication initiation. Methods: Electronic medical record (EMR) data on diabetes medication use was extracted for 2,890 participants from the Shanghai Men's Health Study (SMHS) and Shanghai Women's Health Study (SWHS) with incident breast (n = 633), colorectal (n = 892), lung (n = 822), or gastric (n = 543) cancers diagnosed after 2004. Individuals with and without diabetes diagnosis were analyzed for the association between diabetes medication use (metformin, sulfonylureas, and insulin) and cancer survival using Cox proportional hazards models. Results: After adjustment for patient and clinical characteristics, ever use of any diabetes medication was associated with a decrease in all-cause mortality among all four cancer types (HR = 0.84, 95% CI: 0.74, 0.94). Compared to non-users of any diabetes drug, lower mortality was observed among all cancer patients who ever took metformin (HR = 0.78, 95% CI: 0.65, 0.93) or sulfonylureas (HR = 0.80, 95% CI: 0.69, 0.93). When stratified by initiation of diabetes medication use with respect to cancer diagnosis, the association was significant for both metformin and sulfonylureas use, but only among those who initiated use after cancer diagnosis. When cancers were analyzed individually, significant associations were observed for lung and colorectal cancer cases for metformin or sulfonylureas use among those who initiated use after cancer diagnosis. The inverse associations were predominantly observed among those whose diabetes diagnosis could be verified by EMR. Diabetes medication use was not significantly associated with survival from breast or gastric cancer. Conclusions: Use of metformin or sulfonylureas was associated with improved survival among lung and colorectal cancer patients. The association was primarily observed among those who initiated diabetes medication use after cancer diagnosis. While a possible survival time bias can't be excluded, additional investigation on the topic is needed given the potential translational impact if our finding were proved to be true. Citation Format: Michelle L. Baglia, Yong-Bing Xiang, Gong Yang, Tao Zheng, Honglan Li, Mingrong You, Yong Cui, Yu-Tang Gao, Wei Zheng, Xiao-Ou Shu. Diabetes medication use in association with survival among patients of breast, colorectal, lung, and gastric cancer. [abstract]. In: Proceedings of the 107th Annual Meeting of the American Association for Cancer Research; 2016 Apr 16-20; New Orleans, LA. Philadelphia (PA): AACR; Cancer Res 2016;76(14 Suppl):Abstract nr 3419.