1520s, "an accursed thing," from Latin anathema "an excommunicated person; the curse of excommunication," from Ecclesiastical Greek anathema "a thing accursed," a slight variation of classical Greek anathāma, which meant merely "a thing devoted," literally "a thing set up (to the gods)," such as a votive offering in a temple, from ana "up" (see ana-) + tithenai "to put, to place," from reduplicated form of PIE root *dhe- "to set, put."
By the time it reached Late Latin the meaning of the Greek word had progressed through "thing devoted to evil," to "thing accursed or damned." Later it was applied to persons and the Divine Curse. Meaning "act or formula of excommunicating and consigning to damnation by ecclesiastical authority" is from 1610s.
Anathema maranatha, taken as an intensified form, is held to be a misreading of I Corinthians xvi.22 where anathema is followed by Aramaic maran atha "Our Lord hath come" (see Maranatha).