In J. R. R. Tolkien's fictional Middle-earth, Doriath is the realm of the Sindar, the Grey Elves of King Thingol in Beleriand. Along with the other great forests of Tolkien's legendarium such as Mirkwood, Fangorn and Lothlórien it serves as the central stage in the theatre of its time, the First Age. On this stage many of the notable characters and events appear such as: The Geste of Beren and Lúthien from the The Lays of Beleriand, parts of The Children of Húrin and, of course, The Silmarillion. It is called the 'Fenced Land' because Melian, the queen of that land, put a girdle of enchantment about it, so that none can enter without the leave of King Thingol.
''"A dark and hidden king did dwell,
Lord of the forest and the fell;
And sharp his sword and high his helm,
The king of beech and oak and elm.
Doriath is a land of forests adjoining the great River Sirion and its eastern tributaries: Mindeb, Esgalduin, Celos, and Aros. Within it are the forests Neldoreth or Taur-na-Neldor, the northern beech forest, Nivrim, West-march, an oak forest, Region the main forest, and Arthórien between Aros and Celon. Additionally, the forests of Brethil and Nan Elmoth were held as part of Doriath, these last two lay outside the Girdle of Melian. Elu Thingol, lord of the Sindar, sees all of Beleriand as his realm, from the Gelion to Belegaer. In the midmost part of Doriath is a natural feature, a vast hill with many caves. Towards the end of the Ages of Melkor's captivity, Melian counselled Thingol that the peace of his realm would not long endure and so with the aid of the Dwarves of Belegost he delved there the wondrous fortress called Menegroth, the Thousand Caves. It is said that of all Kingdoms of Beleriand in the legends "the most mighty and the longest free was Thingol of the Woods.
Long before, during the march of the Elves from Cuiviénen, the Vanyar and the Noldor passed through these woods on the Great Journey. Finwë and the Noldor dwelt there for a time. But they were ferried across on Tol Eressëa while the Teleri yet searched for their lord, for Thingol was lost in Nan Elmoth, and when Ulmo returned for them, a part of that people remained behind, and the Sea filled them with sorrow. They later become known as the Sindar, Elves of the Twilight, and when Thingol returned, revealed as a lord of great reverence, he became the lord of that people and ruled from his kingdom in Doriath.
Doriath was originally known as Eglador, meaning "Land of the Forsaken" for so those of the Teleri that remained in Beleriand called themselves. In the last years before the First Age the Orcs assailed the King of Doriath and after that Battle, the first of many in the Wars of Beleriand Melian fenced that realm, with unseen walls of shadow, the forests of Neldoreth, Region, and Nivrim. Thingol formed a defence of his realm with companies of archers that guarded the borders called March Wardens. With the help of Dwarven smiths, he built an army of Elves armed with axes, long spears and swords and armoured coats of scale-mail and shields. Thingol then summoned all the wandering Sindar to Doriath, but many remained in the wild. After the First Battle of Beleriand, many Laiquendi, Green Elves or Nandor as well as some Avari removed to Doriath, establishing themselves as the 'Guest Elves' of Arthórien.
The Dwarves of Belegost and Nogrod are contracted to build the halls of Menegroth, which became Thingol's capital city and fortress. The great tree Hirilorn, wherein Lúthien is placed by Thingol to prevent her from meeting Beren, was outside the front entrance of Menegroth. A great stone bridge across the river Esgalduin is the only access to the gates. Both the river Sirion and its tributary Esgalduin are uncrossable, except by boat or bridge.
When the Noldor return to Middle-earth at the beginning of the First Age, the borders of Doriath are already closed for defence against Morgoth and Thingol allows entry only to the children of Finarfin, who are related to him through his brother Olwë.
When later in later years Men arrived in Beleriand, they are also refused passage through, but at Finrod's request the Haladin were allowed to live in Brethil as vassals to Thingol charged with the protection of the Crossings of Teiglin.
Beren, son of Barahir and lord of the First House of Men, passes through the Girdle as Melian foretold, and arrives in Neldoreth. There Thingol's daughter Lúthien falls in love with him. After the Quest for the Silmaril, the great Wolf, Carcharoth, also breaches the Girdle, but Thingol, Beren, Huan the hound and Thingol's captains Beleg and Mablung hunt and kill the beast.
Túrin, son of Húrin and Morwen, is sent to Doriath, and lives there until he comes of age, when he flees after a deadly quarrel with an Elf. Later his mother and sister, Morwen and Nienor are harboured there, until they leave to search for Túrin and are lost.
Húrin brings the treasure of Nargothrond to Doriath after the fall of Finrod's realm, and Thingol engages the Dwarves of Nogrod to combine the Silmaril of Beren and Lúthien with the Nauglamír, the Dwarves' Necklace. The Dwarves, caught in a spell of lust for the necklace, murder Thingol, steal the necklace and flee. Most are slain and the necklace returned. Word is brought to the kin of the Dwarves and their army perpetuates the first Sack of Doriath. Doriath is briefly restored under Beren and Lúthien's son Dior, but he is attacked and killed by the sons of Fëanor in the Second Kinslaying and second Sack of Doriath. Afterwards, Doriath remains abandoned until it is broken in the War of Wrath and sinks along with much of the rest of Beleriand.