The castle was built in the Everfree Forest, with one account indicating that its site was selected for proximity to the Tree of Harmony. By the same account, construction was initially interfered with, but later assisted by, a Manticore named Melvin whose home was disturbed by the building effort. Princess Luna specifically designed the castle with a number of secret passageways and various other tricks, which she used to play pranks on visitors such as Princess Platinum. However, Chancellor Puddinghead managed to turn the tables on her using her own booby traps.
After Stygian became the Pony of Shadows, he attacked the Pillars of Old Equestria and fought them in the castle, though he seems to have been driven off or else voluntarily retreated. Some time later, Luna would take the castle as her base when she rebelled against Celestia and became Nightmare Moon. The ensuing battle between Alicorns left the castle in ruins, and Celestia subsequently-if she hadn't already-took up residence in Canterlot Castle. Perhaps as a result of these two conflicts, a legend grew among local ponies that the Pony of Shadows-supposedly a remnant of Nightmare Moon's magic-appeared in the castle at night.
The Mane Six organized their Nightmare Night trick by sending the Young Six to the castle but after realizing how dangerous their pranks were, they rushed in the castle to save them, only to realize the kids already saved themselves.