The 84-year-old had half of his colon removed on July 4 due to a severe narrowing of his large intestine.
It was his first major surgery since he became pope in 2013.
The procedure was planned for when the pope’s audiences are suspended and he would normally be taking time off.
Francis thanked doctors for the success of the operation and offered prayers to others during a visit to Santa Maria Maggiore basilica on his way home, the Vatican said.
The pope traditionally visits the basilica after returning from a foreign trip to pray before an icon of the Virgin Mary.
He sat in the passenger seat of the Ford car which left Rome's Gemelli Polyclinic at about 10.45am.
The car went in a side entrance of the Vatican about an hour later following the detour to the basilica.
The Ford stopped before reaching the gate and Francis got out with the help of a bodyguard.
Vatican spokesman, Matteo Bruni, confirmed Francis' return from the hospital and visit to the basilica.
He said the pope had "expressed his gratitude for the success of his surgery and offered a prayer for all the sick, especially those he had met during his stay in hospital”.