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), apparently a solemn formula of confirmation, like amen; but possibly it is a false transliteration of Hebrew mohoram atta "you are put under the ban," which would make more sense in the context. [Klein]