In 1294, Celestine V was chosen after a conclave that lasted three years. However, just six months into his pontificate he announced his intention to resign because he considered himself unsuitable for the position. His resignation gave way to the Canon Law which allows Popes to resign at free will.
The third Pope to announce his intention to leave the Chair of Peter was Gregory XII in 1415. His resignation is seen as a sacrificial gesture to heal the Great Western Schism at the time.