The French president, Emmanuel Macron, was granted an unusually long meeting with Pope Francis in which they discussed migration issues, conflict in the Middle East and the future unity of Europe.

In his first visit to the Vatican, Macron spoke behind closed doors to the pope for 57 minutes – the pontiff’s longest meeting with a head of state, exceeding his lengthy talks with Barack Obama and almost double the audience granted to Donald Trump.

They privately discussed the arrival in Europe of migrants fleeing poverty and conflict – an issue that has sparked clashing views among EU member states. Macron has taken a hard line on immigration, while last week the pope urged leaders to welcome all the refugees they could properly integrate into society.

Pope Francis exchanges gifts with Emmanuel and Brigitte Macron in the Apostolic Palace. Photograph: Franco Origlia/Getty

After their talks, the pope presented Macron with a bronze medal of Saint Martin, a fourth-century symbol of generosity, and made a point about leaders helping the poor.

Handing the medal to Macron, the pontiff said it was the “vocation of those in government to protect the poorest. We are all poor.”

The Vatican described the talks with Macron as cordial, saying there was an “an exchange of views on various situations of conflict, particularly in the Middle East and in Africa and a joint reflection on the prospects of the European project”.

Macron presented the pope with a copy of The Diary of a Country Priest, by Georges Bernanos. The 1936 novel recounts the story of a young French priest who learns humility in tending to the faithful.

“I’ve already read it. Many times.” the pontiff said. “It did me well to read it.”

Macron’s visit to the Vatican drew particular scrutiny in France, where the president’s courting of Catholic voters has drawn criticism from the secular left.

The pope, flanked by the Macrons. Photograph: Reuters

Secular France has a strict separation between church and state, enshrined in law in 1905.

In a speech to Catholics this year, Macron said he wanted to “repair the bond” between church and state.

There have been tensions between politicians and Catholic voters, notably under the former Socialist president François Hollande, when hundreds of thousands of people marched against plans to legalise same-sex marriage.

Macron speaks during a ceremony to receive the title of honorary canon of St John Lateran, the cathedral of Rome. Photograph: Alessandra Tarantino/AP

Macron’s advisers describe him as a spiritual agnostic. He was educated at a Jesuit school, where his future wife, Brigitte, was a teacher. As a child, he asked to be baptised a Catholic despite the misgivings of his atheist parents.

Before the Vatican visit, Macron was made an honorary canon of St John Lateran, the cathedral of Rome, a tradition dating to the 15th century when the French state and church were indistinguishable.

Several of Macron’s predecessors have declined the title, including the Socialists François Mitterrand and François Hollande, to avoid associating themselves with religious imagery.