The aim of the present study was to investigate the efficacy and prognosis of surgical treatment in anorectal malignant melanoma (ARMM) as well as its effects on immune and inflammatory profiles. A total of 64 patients with ARMM were enrolled and divided into control group (n=32) and observation group (n=32) based on different therapeutic methods. Patients in the observation group underwent wide local excision, while those in the control group were given non-surgical treatment. The immune function was compared between the two groups after treatment. The expression levels of serum IL-17, IL-23 and vascular endothelial growth factor (VEGF) were compared between the groups before and after treatment. Patients were followed up for 5 years to observe the recurrence and survival rates in the two groups. Compared with those in the control group, the levels of cluster of differentiation (CD)3 + , CD4 + and CD4 + /CD8 + were increased, while the level of CD8 + was reduced in the observation group (P<0.05). The levels of serum IL-17, IL-23 and VEGF were significantly lower in both groups at 4, 6 and 8 weeks after treatment than those before treatment, and the decrease was more obvious in the observation group (P<0.05). The observation group exhibited a notably elevated 5-year survival rate and a remarkably decreased recurrence rate in comparison with the control group (P<0.05). For ARMM, surgical treatment is more effective than non-surgical treatment, which has less effect on immune function, is able to reduce serum IL-17, IL-23 and VEGF levels, lower recurrence rate, improve patient survival rate, and plays a certain positive role in prolonging the survival time of ARMM patients.