In patients infected with human immunodeficiency virus (HIV) no effective surgical procedure has been described for anorectal ulceration that is resistant to medical thearpy. This study was designed to determine the effectiveness of surgical excision of anorectal ulcers, with or without mucosal advancement. The medical records of patients with HIV and anorectal pathology diagnosed between 1984 and 1994 were reviewed. Patients with anorectal ulcers were divided into group A which was treated only with excision and group B in which excision was combined with mucosal advancement. Surgical treatment was considered successful if relief of symptoms was achieved within 4 weeks of the operation. Excision of anorectal ulcers was successful in seven of 16 patients (44 per cent) in group A. Relief of symptoms was achieved in 12 of 13 patients (92 per cent) in group B when surgical excision was combined with mucosal advancement, which is significantly better than the results in group A (P = 0.02). This non‐randomized study indicates that after unsuccessful medical treatment persistent symptomatic ulcers should be treated operatively by excision with mucosal advancement.