Magic Circle

D&D 2024 spell: Magic Circle. Source: Player's Handbook (2024). level 3, school Abjuration, casting time 1 minute, range 10 feet, duration 1 hour

You create a 10-foot-radius, 20-foot-tall Cylinder [Area of Effect] of magical energy centered on a point on the ground that you can see within range. Glowing runes appear wherever the Cylinder [Area of Effect] intersects with the floor or other surface. Choose one or more of the following types of creatures: Celestials, Elementals, Fey, Fiends, or Undead. The circle affects a creature of the chosen type in the following ways: The creature can't willingly enter the Cylinder [Area of Effect] by nonmagical means. If the creature tries to use teleportation or interplanar travel to do so, it must first succeed on a Charisma saving throw. The creature has Disadvantage on attack rolls against targets within the Cylinder [Area of Effect]. Targets within the Cylinder [Area of Effect] can't be possessed by or gain the Charmed or Frightened condition from the creature. Each time you cast this spell, you can cause its magic to operate in the reverse direction, preventing a creature of the specified type from leaving the Cylinder [Area of Effect] and protecting targets outside it.

At Higher Levels

Using a Higher-Level Spell Slot The duration increases by 1 hour for each spell slot level above 3.

Source: Player's Handbook (2024), p. 293 - Licenses and attribution