'Precious, precious, precious!' Gollum cried. 'My Precious! Oh my Precious!' And with that, even as his eyes were lifted up to gloat on his prize, he stepped too far, toppled, wavered for a moment on the brink, and then with a shriek he fell. Out of the depths came his last wail Precious, and he was gone.
...
'Yes,' said Frodo. 'But do you remember Gandalf's words: Even Gollum may have something yet to do? But for him, Sam, I could not have destroyed the Ring. The Quest would have been in vain, even in the bitter end. So let us forgive him! For the Quest is achieved, and and now all is over. I'm glad you are here with me. Here at the end of all things, Sam.