Diagnosing anal squamous cell carcinoma (SCC), which is often preceded by anal intraepithelial neoplasia (AIN), may be challenging in small biopsies. Cytokeratin 17 (CK17) is a basal/myoepithelial cell keratin induced in activated keratinocytes and associated with disease progression in SCC of the uterine cervix, esophagus, and oral cavity. We investigated the utility of CK17 in diagnosing invasion in anal squamous neoplastic lesions. Immunohistochemical staining for CK17 was evaluated in 11 AINs, 12 invasive SCCs, 8 invasive SCCs with basaloid features (BSCC), and 2 invasive pure basaloid carcinomas. The pattern of staining was scored as surface/central, peripheral/rim, diffuse, or absent. All cases of invasive SCC and BSCC stained positive for CK17. Eleven of 12 (92%) SCCs showed diffuse staining, and 1 of 12 (8%) showed peripheral staining. Six of 8 (75%) BSCCs showed diffuse staining, and 2 of 8 (25%) showed peripheral staining. Both pure basaloid carcinomas were negative for CK17. One of 11 (9%) AINs was diffusely positive for CK17; all other AINs had surface or absent CK17. Of the 6 patients with concurrent AIN and invasive carcinoma, superficial expression of CK17 was present in 1 AIN, whereas all invasive components showed diffuse staining. The sensitivity and specificity of CK17 for identifying invasion in SCC and BSCC was 100% and 91%, respectively. Peripheral or diffuse staining for CK17 is a useful marker of invasion in anal squamous neoplastic lesions. A potential pitfall in the utility of CK17 is that the pure basaloid variant of anal carcinoma is negative for CK17.