Pope Francis welcomed President Trump to the cradle of Roman Catholicism on Wednesday, delivering a message of peace even as the pontiff emphasized his role as the world’s moral counterpoint to the president’s nationalist agenda.

The two met in the pope’s private study for nearly half an hour, joined only by an interpreter. The pontiff, in white papal dress and a pectoral cross on a chain around his neck, sat behind a small desk while Trump, in a dark suit and navy striped tie, took the single chair across from him as if interviewing for a job.

After some initial awkwardness — Trump looked somewhat uneasy as he was kept waiting for a few seconds in the Saint Ambrose room before shaking hands with Francis, who was stone-faced at first — the atmosphere soon warmed.

The pair seemed to set aside their differences from last year’s campaign, with Trump appearing both presidential and deferential, while the pope, smiling slightly, seemed to be visually appraising him.

A brief Vatican communique later called the meeting “cordial,” and expressed hope for collaboration with the administration on “health care, education and assistance to immigrants.”

1 of 60 Full Screen Autoplay Close Skip Ad × President Trump shakes hands with Pope Francis at the Vatican during his first trip overseas as president. View Photos The U.S. president traveled to Saudi Arabia, Israel, Rome, Belgium and Sicily, Italy. Caption The U.S. president traveled to Saudi Arabia, Israel, Rome, Belgium and Sicily, Italy. May 27, 2017 German Chancellor Angela Merkel, left, speaks to President Donald Trump as Tunisia's President Beji Caid Essebsi listens during an expanded session at the Group of Seven Summit in Taormina, Italy. Philippe Wojazer/Reuters Buy Photo Wait 1 second to continue.

It said Trump and Francis had exchanged views on “international affairs and the promotion of peace in the world through political negotiation and interreligious dialogue, with particular reference to the situation in the Middle East and the protection of Christian communities.”

Trump and Francis spoke about how religious communities can combat suffering in “crisis regions,” such as Syria, Libya and areas controlled by Islamic State terrorists, according to the White House. The president told the pope that their states share “many fundamental values,” such as promoting human rights, combating global famine and protecting religious freedom, the White House said.

Trump later met with Cardinal Pietro Parolin, the Vatican secretary of state, who raised the issue of climate change and encouraged the president to maintain the U.S. participation in the Paris climate accords, a decision the administration is debating.

“We had a good exchange [about] the difficulty of addressing climate change, responses to climate change, and ensuring that you still have a thriving economy and you can still offer people jobs so they can feed their families and have a prosperous economy,” Secretary of State Rex Tillerson told reporters.

Trump called the meeting “great” and “fantastic.”

[Trump’s budget proposal even has GOP allies wincing]

“He is something,” Trump said of Francis. “We’re liking Italy very, very much, and it was an honor to be with the pope.”

From left, Ivanka Trump, first lady Melania Trump and President Trump stand with Pope Francis during a meeting on Wednesday at the Vatican. (Evan Vucci/AP)

Once Francis rang a bell signaling that the one-on-one discussion had concluded, the pair exchanged official gifts. The pope presented Trump with a medallion by a Roman artist in the shape of an olive tree, the symbol of peace.

“We can use peace,” Trump said.

Later, moments before taking off for Brussels, Trump tweeted: “Honor of a lifetime to meet His Holiness Pope Francis. I leave the Vatican more determined than ever to pursue PEACE in our world.”

At the Vatican, Francis also offered copies of his writings on the topics of family, the joy of the gospel and “care of our common home, the environment.”

“Well, I’ll be reading them,” the president said.

Trump’s visit to the Vatican capped his quest this week to promote “tolerance” among followers of three of the world’s religions and cooperation against extremism. On his maiden foreign trip as president, Trump has addressed a summit of Muslim leaders in Saudi Arabia, and met with Israeli and Palestinian leaders in Jerusalem and Bethlehem.

Arguably the West’s most influential leaders, Trump and Francis hold divergent worldviews on everything from migrant rights to climate change.

Underscoring the differences between them, Trump’s administration introduced a budget proposal Tuesday that would deeply cut assistance to the poor. Francis, meanwhile, spent Tuesday commemorating the Rev. Oscar Romero, a Salvadoran archbishop gunned down by right-wing death squads and who championed social justice and the rights of the poor.

Following their private meeting, Trump expressed gratitude for the audience.

“Thank you,” he said, shaking hands with the pontiff. “Thank you. I won’t forget what you said.”

[Opinion: Does Trump need an atlas?]

First lady Melania Trump, in a black dress with a black veil, also was greeted by the pope and engaged in a brief conversation. She appeared more animated than during the earlier parts of the trip, when she gazed into the distance without expression while her husband was the center of attention.

The first lady chatted with Francis, who said something to her in English that made her laugh.

“What do you give him to eat, potica?” Francis asked, referring to the president and a Slovenian dessert.

The first lady, who was born in Slovenia, smiled and repeated “potica.”

One of the pope’s attendants gave Melania Trump a small object that appeared to be a rosary, as she was walking away. She turned back and asked the pope to bless it, which he did.

Before departing the Vatican, the Trumps were given a private tour of the Sistine Chapel and St. Peter’s Basilica, and the president held a 50-minute meeting with Parolin and Archbishop Paul Gallagher, who effectively serves as the Vatican’s foreign minister.

The president later met with Italian President Sergio Mattarella at the Quirinal Palace in Rome, and with Prime Minister Paolo Gentiloni at Villa Taverna.

Among the gifts Francis presented to the president was a copy of the pontiff’s 2015 encyclical on the environment and its relationship to social justice. Although it predates Trump’s presidency, the document seemed a message to an administration that has questioned climate change and whose economic policies are centered on profit and growth.

In it, Francis chastised the world’s leading nations for lacking the will to address man-made climate change. “The warming caused by huge consumption on the part of some rich countries has repercussions on the poorest areas of the world, especially Africa, where a rise in temperature, together with drought, has proved devastating for farming,” he wrote.

Trump is in the process of deciding whether to uphold the Paris climate change agreement, amid debate among his advisers. The agreement is expected to be the subject of discussion between Trump and new French President Emmanuel Macron and other European leaders when they meet in Brussels this week.

[Opinion: Melania and Ivanka show world what feminine power looks like]

The pope also gave Trump a copy of his January 2017 World Day of Peace message, saying, “I signed it personally for you.”

“Ooh,” Trump commented. “That’s so beautiful.”

The message noted that although the past century was marked by two world wars, “today, sadly, we find ourselves engaged in a horrifying world war fought piecemeal,” including “the abuses suffered by migrants and victims of human trafficking; and the devastation of the environment.” Echoing the Rev. Martin Luther King Jr., he called for increased engagement in “active and creative nonviolence.”

Trump gifted Francis a first-edition set of King’s five books, which were custom-bound and accented with gold hand-tooling. Francis cited King’s march from Selma to Montgomery, Ala., in his 2015 address to a joint session of Congress.

“These are books from Martin Luther King,” Trump said. “I think you will enjoy them.”

The president also presented a handmade bronze sculpture created by Florida artist Geoffrey Smith, titled “Rising Above,” and designed to evoke the values of unity and resilience.

Trump’s daughter Ivanka Trump, who wore a black dress and veil, and her husband, Jared Kushner, a senior White House adviser, also met the pope.

In a separate room in the Apostolic Palace, Trump introduced members of his family to Francis, and they shook the pontiff’s hand. The Americans included Tillerson, national security adviser H.R. McMaster, State Department officials Margaret Peterlin and Brian Hook, as well as three longtime aides who are close to the president: Hope Hicks, his communications adviser; Dan Scavino, who manages his Twitter account; and Keith Schiller, his former bodyguard who directs Oval Office operations.

In a high-profile exchange last year, Trump and Francis traded barbs. The pope called Trump’s proposal to build a wall on the U.S.-Mexico border, a rallying cry for his campaign, “not Christian.” Trump replied by calling any religious leader who would say such a thing “disgraceful.”

Nevertheless, Vatican officials — while seeking to play down a meeting that many speculated could either be very diplomatic or easily run off script — have described Wednesday’s encounter as an opportunity for the U.S. president and the head of the Roman Catholic Church to find common ground.

“It’s in nobody’s interest to try to win arguments,” said a senior Vatican official who spoke on the condition of anonymity to preview the meeting. “The Holy See and the U.S. government will have their differences — as they always do — but there’s a whole range of issues they can work together on, and this kind of meeting can serve to get them off to a good start.”

Trump was “honored to go and meet the pope,” adding that he “has a lot of respect” for Francis, a senior administration official told reporters Tuesday aboard Air Force One, as the president flew to Rome from Israel.

In St. Peter’s Square outside the basilica, crowds of tourists and the faithful were gathering for the pope’s appearance at his regular General Audience on Wednesdays.

“This is a beautiful meeting,” Carlos Castillo, 18, of Vancouver, B.C., said of Trump’s visit. “They have been criticizing each other from afar, and now they are face to face.”

Herel Hughes, 24, a university student from Chicago, said, “I hope the pope will be able to talk some sense into Trump.”

On Tuesday night, a small number of Italians and Americans living in Rome organized an anti-Trump demonstration in Rome’s Piazza Bologna.

“I am not a Catholic, but this pope has stood up for migrant rights, for the poor, for everything Trump doesn’t,” said Michele Renda, 39, who held a sign reading, “Rome Resists.” “I think it’s outrageous that Trump is coming for the photo with the pope, to try to prove he is something he is not.”

“We in Italy, in Europe, looked up to the United States for its democracy,” Renda said. “But not with Trump. Not with what he stands for.”

On Wednesday, police here took a zero-tolerance approach toward protesters. A group of Americans living in Rome reported in a Facebook post that their fliers, with the message “Build Bridges Not Walls,” were confiscated. After being briefly detained, according to their statement, authorities told them that “any material that is even directly protesting Trump is prohibited in the center of Rome until he leaves the city.”

Stefano Pitrelli in Vatican City contributed to this report.

Read more:

In Israel, Trump urges new Middle East harmony but faces old suspicions

What you need to know about Trump’s first trip abroad