The pontiff left hospital in a wheelchair and spoke with well-wishers and medical staff who had gathered outside the entrance to say goodbye, as seen on a CNN video.
People had also lined the walkway outside the the facility in a bid to see the pope, who smiled and waved to those waiting.
He was surrounded by security as he left and was assisted into a waiting car. Francis was photographed praying at the Basilica of Santa Maria Maggiore in the Italian capital soon after his release.
“The pope is fine. He is better than before,” said Sergio Alfieri, the surgeon who operated on the pontiff last week, on Friday, outside the hospital, after the pontiff was discharged.
Before returning to the Vatican, the pope also stopped for a brief visit at a convent at the Institute Maria Santissima Bambina, before greeting and thanking security guards outside an entrance to the city, the Vatican press office said.
He will deliver his weekly Angelus prayer this Sunday and is well enough to keep all of his appointments except for a general audience next Wednesday, the Vatican added.
Pope Francis had remained in the Gemelli hospital after undergoing abdominal surgery last Wednesday.
In an interview with Vatican Media, Alfieri, the pontiff’s surgeon, said he is not worried about the pope’s health and that he is well enough to travel.
“The surgery went well. Do I have any concerns about the pope’s health? No, in the sense that the Holy Father, compared to other 86-year-old peers, has a perfect heart, has blood tests that many 50-year-olds would envy because he does not have a parameter out of place,” he said.
But the doctor suggested that the pope and those around him should limit their commitments – those “that are burdensome because of what the strains on the abdominal wall might be” – for the first month.
When asked if the pope will be able to make an apostolic journey to Lisbon in August and then to Mongolia, Alfieri said that if the pontiff makes a careful recovery, “he will be able to make this trip in better condition than when he had previously planned it.”
On Thursday, the director of the Vatican Press Office Matteo Bruni said medical staff reported that the pontiff had “rested well during the night. The clinical course continues regularly. Hematochemical examinations are in the normal range.”
Earlier that day, “as a token of thanks, he received the entire operating team formed by the medical staff, nurses, social and health workers and auxiliaries who coordinated, performed and made the surgery possible last June 7,” Bruni added.
The pontiff also visited children in the Pediatric Oncology and Children’s Neurosurgery ward “who in recent days have expressed their affection to the pope through numerous letters, drawings and messages of speedy recovery are cared for,” Bruni said.
“In greeting those present, His Holiness extended his thanks to all the health care staff for their professionalism and efforts to alleviate each other’s suffering with tenderness and humanity in addition to medication,” he said.
The pope joked about his recovery as he left for the Vatican: “Thank you, thank you journalists. I’m still alive.”
Francis has experienced a series of health issues over his lifetime, including a colon surgery two years ago. He had part of one lung removed after struggling with pneumonia as a young man. In 2019, he had ocular surgery at Rome’s Clinic of Pius XI to treat a cataract. He has also suffered with chronic sciatica pain.
In the past year, he has used a cane or a wheelchair to alleviate his knee troubles.
Should Francis be medically impaired for any length of time, the Vatican could face a constitutional crisis. There is no “vice pope” in the Catholic system, meaning someone who can deputize the pope’s authority in his absence.
The Vatican’s secretary of state, currently Italian Cardinal Pietro Parolin, can supervise routine day-to-day management, but he has no powers, for example, to designate bishops or to create or suppress dioceses around the world.
The pope revealed in December that he had already arranged a letter of resignation in the case of permanent medical impairment, shortly after his election in 2013.
Francis said in an interview with Spanish daily ABC that he wrote the letter several years ago and handed it to then-Vatican Secretary of State Cardinal Tarcisio Bertone.
In 2013, Francis’ immediate predecessor, the late Pope Benedict XVI, made the almost unprecedented choice to step down from his post, citing his “advanced age” and shaking the Catholic world.
It marked the first time a pope had resigned in nearly 600 years. The last pope to step down before his death was Gregory XII, who in 1415 quit to end a civil war within the church in which more than one man claimed to be pope.
In a tweet on Friday, Italian Prime Minister Giorgia Meloni welcomed the news of Pope Francis’ discharge.
“With joy I learn of the discharge of His Holiness Pope Francis from the Gemelli Polyclinic,” she tweeted, wishing him “a speedy recovery with the hope that he will soon return to the full exercise of His Magisterium and continue to be a strong and authoritative guide.
An earlier version of this article misstated the time of the pope’s release.
CNN’s Barbie Latza Nadeau reported from Rome. CNN’s Helen Regan wrote from Hong Kong. CNN’s Antonia Mortensen, Sharon Braithwaite, John Allen and Valentina Di Donato contributed reporting.