Pope Francis said his brief encounter Saturday with U.S. presidential candidate Bernie Sanders was a sign of good manners, "nothing more," and hardly evidence of interfering in American politics.

The White House hopeful called it a "real honour" to meet "one of the extraordinary figures" in the world, a kindred spirit on economic inequality, which is a main Sanders' campaign theme.

Francis was on his way to Greece to highlight the plight of refugees and Sanders was wrapping up his trip to Rome when they met in the lobby of the Pope's residence, the Domus Santa Marta hotel in the Vatican gardens. The Vermont senator had attended a Vatican conference Friday on economic inequality and climate change, and flew back to New York for campaign events on Saturday.

With St. Peter's Basilica in the background, U.S. presidential candidate Bernie Sanders meets reporters outside the Perugino gate at the Vatican on Friday. (Angelo Carconi/ANSA via AP)

"This morning when I left, Sen. Sanders was there ... He knew I was leaving at that time and I had the kindness to greet him and his wife and another couple who were with them," the Pope told reporters travelling back with him to the Vatican.

"When I came down, I greeted them, shook their hands and nothing more. This is good manners. It's called good manners and not getting mixed up in politics. If anyone thinks that greeting someone means getting involved in politics, they should see a psychiatrist," the Pope said.

Earlier, Sanders said in an The Associated Press interview that he told the Pope that he appreciated the message that Francis was sending the world about the need to inject morality and justice into the world economy. Sanders said that was a message he, too, has tried to convey.

"We had an opportunity to meet with him this morning," Sanders said. "It was a real honor for me, for my wife and I to spend some time with him. I think he is one of the extraordinary figures not only in the world today but in modern world history."

Sanders said he had the chance to tell the Pope that "I was incredibly appreciative of the incredible role that he is playing in this planet in discussing issues about the need for an economy based on morality, not greed."

Sanders and his wife, Jane, stayed overnight at the hotel, on the same floor as the Pope. Francis noted to reporters that members of the Vatican conference that Sanders had attended also were staying at the hotel.

Jeffrey Sachs, a Sanders foreign policy adviser, said there were no photographs taken of the Pope and Sanders together.

The Vatican is loath to get involved in electoral campaigns, and usually tries to avoid any perception of partisanship as far as the Pope is concerned, although Francis in February rebuked Republican presidential candidate Donald Trump over Trump's stand on immigration.

A Sanders supporter holds a welcome sign at the Vatican. (Stefano Rellandini/Reuters)

Popes rarely travel to countries during the thick of political campaigns, knowing a papal photo opportunity with the sitting head of state can be exploited for political ends.

But Francis has been known to flout Vatican protocol, and the meeting with Sanders was evidence that his personal desires often trump Vatican diplomacy.

"His message is resonating with every religion on earth with people who have no religion and it is a message that says we have got to inject morality and justice into the global economy," Sanders said.

Sanders said the meeting should not be viewed as the Pope injecting himself into the campaign.

"The issues that I talked about yesterday at the conference, as you well know, are issues that I have been talking about not just throughout this campaign but throughout my political life," Sanders said in the interview. "And I am just very much appreciated the fact that the Pope in many ways has been raising these issues in a global way in the sense that I have been trying to raise them in the United States."

Sachs said Sanders saw the Pope in the foyer of the domus, and that the encounter lasted about five minutes. Sanders later joined his family, including some of his grandchildren, for a walking tour of St. Peter's Basilica, one of the holiest Catholic shrines.

The trip gave Sanders a moment on the world stage, putting him alongside priests, bishops, academics and two South American presidents at the Vatican conference.

Sanders has been at a disadvantage during his campaign against rival Hillary Clinton, President Barack Obama's former secretary of state, on issues of foreign policy. But Sanders was peppered with questions from academics and ecclesiastics during Vatican conference in a manner that might have been afforded a head of state.

The invitation to Sanders to address that session raised eyebrows when it was announced and touched off allegations that the senator lobbied for the invitation.

But the chancellor for the pontifical academy, Bishop Marcelo Sanchez Sorondo, said he invited Sanders because he was the only U.S. presidential candidate who showed deep interest in the teachings of Francis.

Once back home, Sanders was set to refocus on Tuesday's pivotal presidential contest in New York, a state with a significant number of Catholic voters. Clinton holds a lead among the delegates who will determine the Democratic nominee, and Sanders is trying to string together a series of victories in upcoming contests to draw closer.