Variation of earlier arsehole, from Middle English arshole, arcehoole, equivalent to ass + hole. Cognate with Norwegian rasshøl, Swedish arsle. Compare also German Arschloch. Attested from the 1370s, replacing earlier Old English earsþyrel.
First recorded in Middle English, as ers hole (Glouc. Cath. Manuscript 19. No. I., dated 1379, cited after OED), ars-hole (Bodleian Ashmole MS. 1396, dated ca. 1400, ed. Robert Von Fleischhacker as Lanfrank's "Science of Cirurgie", EETS 102, 1894, cited after OED.)
Slang figurative usage dates to the 20th century; it was used of an uninviting place (compare shithole) in the 1920s, and then of an anti-social or despicable person from at least the 1950s (Harvard Advocate 137, March 1954). It also used appositionally (as in "You're an asshole moralist", T. Chamales, ).