(CNN) -- Pope Benedict XVI has pardoned his former butler, Paolo Gabriele, weeks after he was sentenced to 18 months in prison for leaking the pope's private papers, Vatican spokesman Father Federico Lombardi said.
The pope visited Gabriele in prison "in order to confirm his forgiveness and communicate in person his decision to grant Mr. Gabriele's request for pardon, thereby remitting the sentence passed against the latter," said a Vatican statement.
"This constitutes a paternal gesture toward a person with whom the Pope shared a relationship of daily familiarity for many years."
Gabriele was immediately released and has returned home, the statement said.
"Since he cannot resume his previous occupation or continue to live in Vatican City, the Holy See, trusting in his sincere repentance, wishes to offer him the possibility of returning to a serene family life," it said.
Gabriele, one of the pope's closest personal assistants, was convicted in October of aggravated theft for leaking secret papers from the pontiff's personal apartment to an author who included them in a best-selling book.
During the high-profile trial, Gabriele declared himself not guilty, but said he had abused the pope's trust. He asked forgiveness of the pontiff for his actions, which he said were intended to expose wrongdoing.
The Holy See media office had previously indicated that Gabriele could be pardoned. He has been held in a cell in Vatican City since October.
Gabriele was arrested in May, following a Vatican investigation into how the pope's private documents appeared in the book "Sua Santita" ("His Holiness"), by Italian journalist Gianluigi Nuzzi.
The book, based on the papers, revealed claims of corruption in the church's hierarchy.
At his trial, police told how they found more than 1,000 important documents among a stash of hundreds of thousands of papers in Gabriele's apartments in Vatican City and Castel Gondolfo, a town near Rome.
Among them were original papers signed by Pope Benedict XVI, some of them stamped with an order for destruction, according to the journalists allowed to attend the trial.
Also found in his possession were a gold nugget belonging to the pope, a signed check made out to Pope Benedict XVI for 100,000 euros and an original version of Virgil's Aeneid from 1581.
CNN's Mitra Mobasherat contributed to this report.