Leo, on a three-country 12-day South America tour, ended his Argentina visit with an outdoor Mass at the shrine of Our Lady of Lujan, Argentina's most important Catholic devotional site, where throngs of pilgrims had gathered for days in advance for a chance to see him.
The Mass drew a two million-strong crowd that stretched for kilometres outside the shrine, located about an hour west of Buenos Aires.
People pressed against security barriers, chanting "Leo, Leo, Leo" and waved white-and-yellow Vatican flags as he arrived in an open-air popemobile.
Some in the crowd had walked as far as 10km to arrive, with many streets closed as a security measure.
In his sermon, Leo asked God to protect Argentina and urged Argentines to have a place for everyone in their society, "especially those who are most in need: the poor and the hungry, migrants, the sick and prisoners".
The Pope on Wednesday also visited one of Argentina's largest penitentiaries, where he hugged several inmates and urged guards to treat detainees humanely.
During his three-day visit to Argentina, Leo has urged consideration for the disadvantaged at a time when libertarian President Javier Milei's austerity agenda has been criticised by the Church for affecting the poor.
Milei's eyes welled with tears as he bid farewell to Leo on the tarmac, a surprising display of emotion from a president known for piling insults on Leo's predecessor, Francis, an Argentine who never returned home after becoming pontiff.
Pope Leo will next embark on a more personal leg of the trip, returning to the place he served as a missionary for about 20 years before becoming pontiff last year.
As a dual citizen of the United States and Peru, he's the first pontiff from each country.
The visit is expected to include emotional scenes as the Pope sees old friends and spends three days in the northern city of Chiclayo, where he was bishop from 2015 to 2023.
"My heart is so excited that it makes me want to cry with joy," said Zuly Castillo, who served as Leo's secretary when he was bishop of Chiclayo.
Across from her office, a life-size cardboard cutout of the Pope now welcomes visitors to his former residence.
"Peru is the crown of the trip, the homecoming of the first Peruvian Pope, no matter where he was born," said Gustavo Morello, an associate professor of sociology at Boston College.
"This is a return to his origins without any doubt," Morello said.
Leo is due to land at Peru's Callao Air Base later on Wednesday.
Peru has prepared for the homecoming with fervour: a 14-metre statue depicting Leo with outstretched arms towers over a seaside park in Callao, merchants in Lima are selling Pope-themed shirts and souvenirs, and inmates at the country's largest women's prison have stitched velvet dolls bearing his likeness.
Leo will celebrate Mass in all his old stomping grounds including at the nearby sanctuary of St Turibius of Mogrovejo in Zaña, a city that is a hub of Afro-Peruvian culture, and where the Pope often visited to pray to the saint of his devotion.
Leo will also meet with popular groups of faithful and representatives of local traditions in Cusco - the capital of the Inca empire, an important city of Spanish colonial rule and an important cultural destination, including the nearby ruins at Machu Picchu.
The Pope will celebrate Mass in Cusco's main square, where in 1781 the indigenous leader Túpac Amaru II was killed following the most significant rebellion against the Spanish during the colonial era.
with AP