French President Emmanuel Macron had a lengthy closed door discussion on migrants with Pope Francis during his first official visit to the Vatican.
Macron and his wife Brigitte were greeted by a Swiss Guard picket upon arrival at the Apostolic Palace on Tuesday.
The tete-a-tete between the Argentine pontiff and Macron in the Vatican's ornate library lasted 57 minutes - the longest between Francis and a head of state.
Past talks between the pope and a president have never exceeded 50 minutes.
Francis spoke with former US president Barack Obama for 50 minutes and with his successor Donald Trump for just 30 minutes.
Faith and the sensitive subject of the role of the church in French society were thought to be among the topics for discussion, as was the thorny issue of migration, currently casting deep divisions within the European Union.
After they emerged from their closed-door talks, Macron put a hand on Francis' shoulder, and then kissed him on both cheeks in affectionately taking his leave.
Francis reciprocated the warmth, gripping the French leader's arm and then shaking his hands vigorously and smiling broadly as he said goodbye. He shook hands with Macron's wife, Brigitte.
As is his custom with guests, Francis gave Macron a bronze medal of Saint Martin, a fourth century symbol of generosity, and the main texts from his papacy.
Giving the medal to Macron, the Pope said it was the 'vocation of those in government to protect the poorest'.
The French president offered the Pope a 1949 edition in Italian of 'The Diary of a Country Priest' by French Catholic writer Georges Bernanos.
Francis had ushered the French leader into his studio, then the two men chatted amiably a few minutes before media were escorted out of the room.
Last week, the pontiff urged nations to welcome all the refuges they can properly manage.
Before his meeting with the pope, Macron met with the Catholics Sant'Eligio, a lay association closely involved with the reception of migrants.
Macron's visit was strictly Vatican-related, with no meetings scheduled with Italian leaders.
Italy is angry that France sends back migrants who illegally enter France from Italy.
France recently scathingly criticised Italy's new populist government for refusing to allow docking by a private rescue ship with more than 600 migrants aboard.
Earlier this month, France and Italy had called on the European Union to set up asylum processing centres in Africa to prevent 'voyages of death' by migrants across the Mediterranean.
At a meeting in Paris, Macron and Italy's new premier Giuseppe Conte also demanded 'profound' changes to the EU's asylum rules, which put the migrant burden on their port of entry to Europe - mainly Italy and Greece.
The two leaders had been at pains to put on a united front after a bitter row over Italy's rejection of a rescue boat with hundreds of migrants on board.
But Macron's rocky relationship with Italy's ruling populists worsened over the weekend when far-right Interior Minister Matteo Salvini blasted the French president's 'arrogant' stance on immigration.
Salvini further accused Macron of hypocrisy for criticising his hardline approach while France continues to 'push back women, children and men' across the border back into Italy.
Macron argues that France has taken in more asylum seekers than Italy this year as the massive influx across the Mediterranean has slowed.
But Macron's Vatican visit sparked a considerable backlash in France from secularists.
They criticised his recent comments calling for stronger ties between the state and the Catholic Church, saying it blurs the line that has kept religious intervention out of the French government for more than a century.
During his visit to the Vatican, 40-year-old centrist Macron also accepted being made an honorary canon of St John Lateran, the cathedral of Rome, a tradition dating back to the 15th century when the French state and church were indistinguishable.
It's a title that several of Macron's predecessors have declined, including Socialists Francois Mitterrand and Francois Hollande, in a bid to avoid associating themselves with religious imagery.
Macron's decision to accept the honorary title has drawn particular scrutiny at home following the comments in April in which he said he wanted to 'repair' the 'bond' between church and state.
Although historically Catholic, France is secular after matters of state and faith were separated by a landmark law in 1905.
It remains one of the country's most debated rules and was invoked controversially in 2004 to ban religious symbols, including the Islamic headscarf, from schools.
The Vatican visit has also placed Macron's religious views in the spotlight.
Although raised in a non-religious family, Macron decided he wanted to be baptised as a Catholic as a schoolboy, despite his parents' misgivings.
It was 'the start of a mystical period that lasted for a few years,' he told an interviewer during campaigning in 2017.
By his mid-teens, he had distanced himself from the church, however, and he now considers himself to be agnostic.
Asked last year whether he believed in God, he gave a cryptic answer that pointed to his faith in something spiritual and immaterial, but not Catholic in form.
'I believe in a form of transcendence, that's why I thoroughly respect the role of religions in society,' he said during a chat with journalists.
But Macron's enthusiasm for the church appears to stem in part from his belief that religious leaders have a role to play in helping French society overcome a fractious period riven by economic, ethnic and social tensions.
It might also be an electoral calculation as Catholicism is still France's biggest religion and many believers worry that France is moving too far from its traditional Christian roots.
'At a time of great social fragility... I consider it my responsibility to stop the erosion of confidence among Catholics with regard to politics and politicians,' Macron told church leaders in April.
His meeting with Pope Francis was an opportunity to soothe diplomatic tensions with the Vatican which emerged under the presidency of Hollande, a self-described atheist.
The church campaigned against a gay marriage law passed by Hollande and then declined to accept an openly gay career diplomat as France's ambassador to the Holy See.
Aides to Macron believe the current president and pope share a common vision of a united Europe at a time when anti-EU far-right parties are on the march across the continent.
The Argentine pontiff sent a congratulatory telegram to Macron, a former investment banker, after his election in May last year which urged him to build a 'fairer and more fraternal society'.
But they hold different views on the sensitive topic of migration, with Macron repeatedly stating that France 'cannot welcome all of the world's misery' and insisting that economic migrants should be expelled.
Pope Francis insists in his sermons that rich countries must do more to welcome the poor and desperate.
'I don't think the pope will offer platitudes on the issue of migrants,' Matthieu Rouge, a well-connected bishop in the town of Nanterre west of Paris, told AFP.
Macron is expected to invite Pope Francis to visit France, as Hollande did in vain, but the pontiff is not expected to make the trip a priority in the short-term.