The epilogue of the Silmarillion, the very last page, tells the definitive fate of the greatest of the Istari, which coincides also with the end of the Third Age and Elven tales. Tolkien concludes the twilight of the third era of Arda by recalling Círdan's words at the arrival of the wizards, more than two millennia before. The Lord of the Havens, farsighted and wise, had foreseen the destiny of toil awaiting the mission of the Grey Wizard, alongside glory and success. He thus entrusts Mithrandir with Narya, the Ring of Fire, forged to rekindle minds to hope and valour, nourishing the sentiment of mankind which naturally rejects all sorts or prevarication or tyranny. Círdan foretells what is to be: as soon as Gandalf's mission in the world is fulfilled, the last grey ship shall depart from the Havens and the modern era of Arda shall eventually end.
One could not have finished such a wonderful book in a grander manner. The bible of Arda closes its tales with a paramount event taking place on the shores of the sundering sea. A sign. An omen. A marvellous coincidence...
Now all these things were achieved for the most part by the counsel and vigilance of Mithrandir, and in the last few days he was revealed as a lord of great reverence, and clad in white he rode into battle; but not until the time came for him to depart was it known that he had long guarded the Red Ring of Fire. At the first that Ring had been entrusted to Círdan, Lord of the Havens; but he had surrendered it to Mithrandir, for he knew whence he came and whither at last he would return.
‘Take now this Ring,’ he said; 'for thy labours and thy cares will be heavy, but in all it will support thee and defend thee from weariness. For this is the Ring of Fire, and herewith, maybe, thou shalt rekindle hearts to the valour of old in a world that grows chill. But as for me, my heart is with the Sea, and I will dwell by the grey shores, guarding the Havens until the last ship sails. Then I shall await thee.’