Purpose: To compare the efficacy of ranibizumab and aflibercept in the treatment of diabetic macular edema associated with subfoveal retinal detachment. Methods: This is a retrospective, comparative study. The treatment-naïve diabetic macular edema patients who had diabetic macular edema associated with subfoveal retinal detachment and underwent intravitreal aflibercept or intravitreal ranibizumab treatment were included. The patients were treated on a pro re nata treatment regimen after a loading dose of 3-monthly injections and the follow-up time was 12 months. The primary outcome measure of this study was the presence of subfoveal retinal detachment after treatment at different time points. The secondary outcome measures were the change in best corrected visual acuity and central retinal thickness. Results: A total of 46 eyes of 46 patients were included. The aflibercept group consisted of 20 and the ranibizumab group consisted of 26 eyes. During the follow-up period of 12 months, subfoveal retinal detachment was completely resolved in 75% versus 57.7% of the eyes at month 3 (p = 0.2), 90% versus 76.9% at month 6 (p = 0.2), 90% versus 65.4% at month 9 (p = 0.05), and 100% versus 80.8% at month 12 (p = 0.03) in the intravitreal aflibercept versus intravitreal ranibizumab groups. The change in best corrected visual acuity was not statistically different between the groups at months 3, 6, 9, and 12, respectively (p > 0.05 for all). Conclusion: Both intravitreal aflibercept and intravitreal ranibizumab were effective in regards to anatomical and functional outcomes of diabetic macular edema patients associated with subfoveal retinal detachment. Interestingly, intravitreal aflibercept seemed more effective than intravitreal ranibizumab in the resolution of subfoveal retinal detachment at month 12.