The following is a true story; the pope in question is John Paul II and this is said to have happened in the 1990s.
A priest from the Archdiocese of New York was visiting Rome. As he was walking into a church to pray, he noticed a beggar sitting at the front door — not an unusual sight in Rome. But something about this particular beggar bothered him. He didn’t figure it out until he began to pray: he suddenly realized that he knew the man from his days in the seminary.
He immediately went back outside and said to him, "Excuse me, do I know you?" Sure enough, the beggar had been in the seminary with him many years earlier. He had been ordained a priest, but had [in his words] "crashed and burned" in his vocation.
The priest from New York was understandably shaken up when he left the beggar a few minutes later.
That afternoon he was at the Vatican, and had the opportunity to meet the pope and speak with him. He said to him, "Please, Holy Father, pray for this particular man. I went to seminary with him, and he’s now a beggar on the streets of Rome. Please pray for him, because he’s lost."
The Holy Father instructed the priest to go back to the beggar.
He found him—once again—in front of the church, and he said to him, "I have an invitation for the two of us to have dinner with the pope tonight." The beggar said, "No, I can’t." The priest responded, "You’d better, because I’m not going to have dinner with the pope any other way."
So the priest took the beggar to his room, where he provided him with a razor, a much-needed shower, and some clean clothes.
Then they went to dinner. About an hour into the meal, the Holy Father asked the priest from New York to leave the room. He then said to the beggar, "Would you hear my Confession?"
The beggar said, "I’m not a priest anymore." The pope replied, "Once a priest, always a priest."
The beggar said, "But I’m not in good standing with the Church." The pope shot back, "I’m the pope. I’m the bishop of Rome. I can re-instate you now."
The beggar agreed, and Pope John Paul II proceeded to confess his sins.
The beggar-priest barely got the words of absolution out of his mouth before he dropped to his knees and tearfully asked, "Holy Father, will you please hear my Confession?" He confessed, and was restored to good graces with our Lord and the Church.
The Holy Father then invited the New York priest back into the room, and he asked him at what church he had found the beggar. The priest told him. The pope then said to the beggar-priest, "For your first assignment, I want you to go to the pastor there and report for duty, because you’ll be an associate at that parish with a special outreach to the beggars in that area."
And that’s where he is today, serving God and the poor as a priest.
Source: http://www.cfpeople.org/FrRay/3Sun02a.htm. The beggar-priest in question is identified in the source, but as I can't confirm, I won't name him.