The subject of this article or section originates from non-canonical sources. To find out about what is considered "canon" see LOTR:Canon.
Castamir, a Gondorian by birth, served in the army for much of his life and became a decorated war hero. By the last days before the Witch-king's assault of Minas Ithil, he had become the city's leader and foremost general, as well as the father of Idril, who was herself a Second Captain in the city's army.
At some point prior to or during the Witch-king's siege of Minas Ithil, Castamir despaired, and made a deal with the enemy to hand the city and the palantir it housed over, in exchange for the safety of Idril. Following the arrival of the ranger Talion, Castamir secretly left to discuss terms with the Witch-king's subordinates, only to be thought captured and subsequently "rescued" by Idril and Talion. Soon afterwards, he granted the Witch-king and other Nazgul access to the city's tower, where he handed over the palantir, despite Talion and Idril's attempts to prevent him from doing so. The Witch-king, having obtained what he desired, proceeded to kill Castamir, forcing Idril and Talion to flee the city.
Later, the Nazgul Isildur resurrected Castamir as a Barrow Wight along with many other men of Minas Ithil in an effort to vanquish Talion.