Narsil was the sword of King Elendil of the Dúnedain. It was later known as Andúril (see below). The sword was forged during the First Age by the Dwarf Telchar of Nogrod, making it a cousin to the blade Angrist, which cut a Silmaril from the crown of Morgoth. The name contains the elements nar "fire" and thil "white light", referring to the Sun and Moon. The blade presumably was given to one of the Sons of Fëanor, possibly Curufin, to whom Angrist was given. It eventually came to Maglor, who would have given it to Elros.
In the Second Age, Narsil was evidently to be found in Númenor, presumably inherited by Elros, its first king, who was a descendant of many Elven and Edain lords. Although nothing is said of Narsil during this period, it came into the hands of Elendil, a distant descendant of Elros, towards the close of the Second Age.
Elendil used Narsil in the Siege of Barad-dûr, but Sauron killed Elendil and the sword broke into two pieces under him as he fell. Elendil's son Isildur took up the sword and used its shard to cut the One Ring from the hand of Sauron. Isildur took the shards home with him. Shortly before Isildur was killed in the second year of the Third Age in the disaster at the Gladden Fields, the shards were rescued by Ohtar (Lord of the Rings: The Return of the King: Appendix B. The Third year of the Third Age), squire of Isildur's oldest son. He took them to Imladris, where Isildur's youngest son Valandil was fostered.
The Shards of Narsil were one of the heirlooms of the Kings of Arnor, and after the Northern Kingdom was destroyed they remained an heirloom of the Rangers of the North. It was not reforged until the War of the Ring at the end of the Third Age.
In 3019 TA Narsil was reforged in Rivendell as Andúril, (Sindarin for "Flame of the West"), for Aragorn, the heir of Isildur. He carried the sword during his journey south as part of the Fellowship of the Ring, and it featured prominently at several points in the story, where it was sometimes referred to as the Sword that was Broken or The Sword Reforged.
Boromir, son of the Steward of Gondor, travelled to Rivendell in time for the Council of Elrond because of the prophetic dream of his brother Faramir, in which he was told to "seek for the Sword that was broken". Aragorn often uses the sword to help establish his credentials.
Narsil (broken and reforged as Andúril) acts as a symbol of the kingship of Arnor and Gondor. As the Chieftain of the Rangers of the North, Aragorn carries the fragments of the ancient sword, secret but ever vigilant, and the blade is reforged as Andúril when he sets out to reclaim his kingdom.
Changes made in the film
In the motion pictures directed by Peter Jackson, Narsil was not broken in two but in several parts (which were kept at Rivendell), and is not reforged into Andúril until the third film, when Arwen persuades Elrond to have Elven smiths reforge it from the shards and bring to Aragorn. In the books, he actually wears the broken blade and shows it to the Hobbits when they meet at the Prancing Pony in Bree, and its reforging prior to the departure of the Fellowship is a decisive move toward kingship.
Aragorn holds a reverence for Andúril, Flame of the West, which is shown best in The Two Towers book, and is not shown in the film. When asked by Háma to disarm outside Meduseld, he is very reluctant, saying that normally he would give up his weapon "if I bore now any sword but Andúril" (The Two Towers, The King of the Golden Hall). It is an omission from the film on the grace that the sword Aragorn surrenders there was not Andúril, but still rather interesting. However, the movie version of The Fellowship of the Ring does include a scene of Aragorn reverently placing the hilt of Narsil back into the display after Boromir dropped the hilt on the floor.