Pope St. Celestine V resigned his papacy in 1294. Then he lived as a hermit for two years before his death. He is a saint of the Church.
Canon Law allows for a Pope to resign. The citation is Canon 332 paragraph 2. It reads,
§2. If it happens that the Roman Pontiff resigns his office, it is required for validity that the resignation is made freely and properly manifested but not that it is accepted by anyone.
I can only say that from the bottom of my heart, I am grateful. This good priest and bishop, who tried to resign from the CDF multiple times, who has not been able to retire, put himself at our constant service for eight years, "a humble worker in the vineyard of the Lord." The changes he has made for all of the Church will have lasting importance, perhaps in no other field as much as liturgy. He has given us an example of humility and goodness that could have no possible origin other than saintliness. I will miss him, and I am grateful.
Update: I had forgotten about this unusual Pope-to-Pope gesture of the Holy Father's. He placed his pallium, the symbol of the office of Archbishop, on the reliquary of Pope Celestine V.