Ay’s successor was Horemheb , a commoner who had risen through the ranks of the military; Horemheb appropriated Ay’s temple for himself, obliterating every inscription containing Ay’s name and expanding the temple compound with forecourts entered through magnificent, relief-carved pylons . Horemheb ruled Egypt for 28 years, his death marking the end of the XVIIIth Dynasty.