The three elven rings had been crafted independently of Sauron by the Elf smith Celebrimbor; they were, however, crafted using skills taught by the Dark Lord, subjecting the rings to the power of the One Ring whilst it remained in Sauron's possession. In the One Ring's absence, these rings were wielded by the Elves for purposes of good.
The three rings were Vilya, Nenya and Narya. The rings Vilya and Narya went to Elven High King Gil-galad of Lindon, who entrusted Vilya to Elrond and Narya to Círdan, Elven lords of Rivendell and Mithlond, respectively. These rings were kept by Elrond and Círdan following the death of Gil-galad. Following the arrival of the Istari in Middle-earth, Círdan, recognising Gandalf as the wisest of the five and also as a Maiar, passed Narya on to Gandalf. Nenya was originally given to Galadriel, Lady of Lothlórien and Mother of Elrond's wife Celebrían, and forever remained with her.
The three rings lost their powers following the destruction of the One, and passed across the sea with their bearers at the end of the Third Age.
In some accounts, Círdan was the bearer of Narya from the beginning, with Gil-galad only possessing Vilya.