Pope Francis had sharp words Saturday for people who are saying his brief exchange with Bernie Sanders at the Vatican is meddling in the U.S. presidential race, recommending they “find a psychiatrist.”

The pope made the remarks hours after Sander, the Vermont senator seeking the Democratic nomination, said they met briefly at the Vatican and discussed such issues as income inequality and climate change.

The pope later told reporters aboard a plane bound for Greece that he shook hands with Sanders, wife Jane, and another couple as he was leaving the Vatican.

“This is called good manners, and it is not getting involved in politics,” Francis said. “If someone thinks that greeting someone means getting involved in politics, I recommend that he find a psychiatrist.''

Sanders told Fox News on Saturday that the opportunity to talk briefly with the pope was a “real honor” and that he considers him one of the “extraordinary figures” in world history, not just modern times.

The Sander campaign had said it did not expect its candidate would get the opportunity to meet with the pope because he wants to stay out of the U.S. presidential race.

Sanders, the self-described democratic socialist, whose populist message continues to resonate with voters, praised the pope for “enlightening the world about the massive levels of income and wealth inequality, about a culture which rewards greed and ignores people who are hurting (and) about climate change.”

Sanders was in Rome for a Vatican conference this weekend on economic inequality and climate change. The meeting took place before the pope left for Greece, where he is highlighting the plight of refugees.

He trails front-runner Hillary Clinton in the race for the Democratic presidential nomination. But his message about income inequality has helped him win seven of the last eight state primaries or caucuses and stay alive in the contest.

Francis since becoming the leader of the church in March 2013 has been remarkably outspoken on such political-charged issues as climate change and income inequality.

Sanders and his wife stayed overnight at the pope's residence, the Domus Santa Marta hotel in the Vatican gardens, on the same floor as the pope. They were seen at the hotel reception, carrying their own bags.

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

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.

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.

Sachs said the candidate and his wife met the pope in the foyer of the domus, and that the meeting 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 Clinton, President Obama's former secretary of state, on issues of foreign policy. But Sanders was peppered with questions from academics and ecclesiastics during Friday's conference in a manner that might have been afforded a head of state.

The invitation to Sanders to address the Vatican 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 the pivotal presidential contest in New York, a state with a significant number of Catholic voters.