pain: [13] ‘Punishment’ (now encountered only in such phrases as on pain of death) is the ancestral meaning of pain; ‘suffering’ is a secondary development. The word comes via Old French peine and Latin poena from Greek poiné ‘punishment, penalty’. Its original connotations are preserved in the related penal [15], penalty [16], penance [13], penitence [12], and punish, its later associations in the related verb pine. => penal, penalty, penance, pine, punish
pain (n.)
late 13c., "punishment," especially for a crime; also "condition one feels when hurt, opposite of pleasure," from Old French peine "difficulty, woe, suffering, punishment, Hell's torments" (11c.), from Latin poena "punishment, penalty, retribution, indemnification" (in Late Latin also "torment, hardship, suffering"), from Greek poine "retribution, penalty, quit-money for spilled blood," from PIE *kwei- "to pay, atone, compensate" (see penal). The earliest sense in English survives in phrase on pain of death.
Phrase to give (someone) a pain "be annoying and irritating" is from 1908; localized as pain in the neck (1924) and pain in the ass (1934), though this last might have gone long unrecorded and be the original sense and the others euphemisms. Pains "great care taken (for some purpose)" is first recorded 1520s (in the singular in this sense, it is attested from c. 1300). First record of pain-killer is from 1853.
pain (v.)
c. 1300, "to exert or strain oneself, strive; endeavor," from Old French pener (v.) "to hurt, cause pain," from peine, and from Middle English peine (n.); see pain (n.). Transitive meaning "cause pain; inflict pain" is from late 14c. That of "to cause sorrow, grief, or unhappiness" also is from late 14c. Related: Pained; paining.