Agar oligosaccharide (AOS) is a marine prebiotic with apparent anti-inflammatory, antioxidant and anti-tumor effects. During this study, different doses of AOS are added to a basal diet to evaluate its effects on the lifespan, motor vigor and reproduction of male Drosophilamelanogaster. Additionally, the activities of Cu,Zn-superoxide dismutase (Cu,Zn-SOD) and catalase (CAT) and the malondialdehyde (MDA) content in male Drosophila are examined on the 10th, 25th and 40th days. The fly midguts are removed on the 10th and 40th days for analyses of the intestinal microbial community by 16S rDNA sequencing and the expression level of intestinal immunity genes by quantitative real-time PCR (RT-PCR). The results show that AOS significantly prolonged the average and maximum lifespan and increased the antioxidant capacity of male Drosophila. Additionally, AOS significantly regulated the structure of the intestinal flora of "old" flies (40 days) and upregulated the expression of immune deficiency (IMD) genes to improve the intestinal immunity, which could be beneficial for delaying aging in old flies. The above-described results provide a theoretical basis for the application of AOS, a type of marine oligosaccharide, as a nutritional supplement or immunomodulator.