A eunuch (/ˈjuː.nək/ YOO-nək, Ancient Greek: εὐνοῦχος) is a boy or man who has been castrated. Throughout history, castration often served a specific social function. The earliest records for intentional castration to produce eunuchs are from the Sumerian city of Lagash in the 2nd millennium BC. Over the millennia since, they have performed a wide variety of functions in many different cultures: courtiers or equivalent domestics, for espionage or clandestine operations, castrato singers, concubines or sexual partners, religious specialists, soldiers, royal guards, government officials, and guardians of women or harem servants.
Eunuchs would usually be servants or slaves who had been castrated to make them less threatening servants of a royal court where physical access to the ruler could wield great influence. Seemingly lowly domestic functions—such as making the ruler's bed, bathing him, cutting his hair, carrying him in his litter, or even relaying messages—could, in theory, give a eunuch "the ruler's ear" and impart de facto power to the formally humble but trusted servant.