late Old English, in Christian use, "an outward and visible sign of inward and spiritual grace," especially "a sacrament of the Church, one of the religious ceremonies enjoined by Christ or the Church," and later specifically "the sacrament of the Eucharist" (c. 1300), from Old French sacrament "consecration; mystery" (12c., Modern French sacrement) and directly from Latin sacramentum, "a solemn oath" (source also of Spanish sacramento, German Sakrament, etc.), from sacrare "to consecrate" (see sacred).
A Church Latin loan-translation of Greek mysterion (see mystery). The Latin word sacramentum in its secular aspect was used of any engagement or ceremony that binds or imposes obligation, specifically "oath of obedience and fidelity taken by Roman soldiers on enlistment; sum which two parties to a suit first deposit," hence also, "a cause, a civil suit," thus either "a result of consecration" or "a means of consecration." By 3c. it was used in Church Latin for "a mystery, a sacrament, something to be kept sacred; the gospel revelation; a Church sacrament." In theology, particularly, "a solemn religious ceremony enjoined by Christ, or by the church, for the spiritual benefit of the church or of individual Christians, by which their special relation to him is created or recognized or their obligations to him are renewed and ratified."
The meaning "arcane knowledge; a secret; a mystery; a divine mystery" in English is from late 14c. (Wycliffe); from mid-14c. as "a solemn oath, pledge, covenant; a ceremony accompanying the taking of an oath or the making of a pledge." The seven sacraments in the West were baptism, penance, confirmation, holy orders, the Eucharist, matrimony, and anointing of the sick (extreme unction); the Reformation loosened the sense in England.