U.S. Democratic presidential candidate Bernie Sanders and his wife, Jane, visit the Vatican on April 15. (Stefano Rellandini/Reuters)

Sen. Bernie Sanders told a Vatican conference Friday that the global market economy has largely failed working people, breaking from the U.S. campaign trail to deliver a talk on his signature issue of income inequality on an international stage.

“At a time when so few have so much, and so many have so little, we must reject the foundations of this contemporary economy as immoral and unsustainable,” Sanders said.

The address to a prestigious Vatican academy that is nonetheless obscure to most Americans puts Sanders in the company of leftist thinkers and political leaders. Sanders slipped comfortably into the lexicon of European and South American socialist and leftist politics, including the socialist government models of Scandinavia. He told the group that failed and crumbling public schools and annual college tuition priced above the annual wages of many Americans are marks of failure.

[Clinton and Sanders spar ahead of N.Y. primary]

The Vatican gathering — a day after Sanders and rival Hillary Clinton faced off in a Democratic presidential debate in New York — touched on social and economic justice issues that have been a centerpiece for Pope Francis. It also gave Sanders a rare brush with the Italian media, which mobbed and jostled him as he made his way to a brief news conference outside the Vatican walls.

Democratic presidential candidate Bernie Sanders is taking two days off from campaigning to attend Pope Francis's conference on social, economic and environmental issues in Vatican City. Here are five things those men share. (Sarah Parnass/The Washington Post)

In his speech, Sanders repeatedly referred to Francis as an inspiration to seek a more moral economic foundation. The Vermont senator began Friday hoping to see the pontiff later in the day, but no such meeting was scheduled.

“Our very soul as a nation has suffered as the public lost faith in political and social institutions,” Sanders said.

Sanders’s decision to leave the tightening race in New York days before the state primary on Tuesday suggested he might be looking past his dwindling chances in the presidential primary contest with Clinton to what may be a newly prominent role as a global leader on social justice.

Sanders trails Clinton in New York, despite momentum from a string of recent victories. He said little about his own experience during his remarks here, but his startling success advancing extremely liberal ideas has changed the U.S. election and forced his rival to move to the left.

[Sanders hopes for audience with Pope Francis on Vatican trip]

“As Pope Francis has stated: ‘Man is not in charge today; money is in charge, money rules,’ ” Sanders added. “And the pope has also stated: ‘We have created new idols. The worship of the golden calf of old has found a new and heartless image in the cult of money and the dictatorship of an economy which is faceless and lacking any truly humane goal.’ ”

Aides worked to minimize Sanders’s absence from New York and said he is planning to campaign in the state on Saturday after returning from Italy. They also noted that Clinton will be absent from New York over the weekend as she raises money for her campaign in California at events with actor George Clooney.

Democratic presidential candidate Bernie Sanders (I-Vt.) sat down with the Salt and Light Catholic Media Foundation where he called Pope Francis a socialist. (Salt and Light Catholic Media Foundation)

As Sanders spoke in Italy, Clinton made an unannounced visit to a senior center in Harlem, where she spoke about her plans for affordable housing.

She was accompanied by Melissa Mark-Viverito, speaker of the New York City Council.

“Today, too many New Yorkers are struggling to pay rising rents. They’re being priced out of communities where they’ve lived for years, pushed further from jobs and quality schools and good transportation, and Latino and black families are being hit the hardest,” Clinton said.

Among those attending the Vatican conference was Bolivian President Evo Morales, who gave the Argentine-born pontiff three books about the health benefits of the coca leaf, the raw ingredient for cocaine, the Associated Press reported.

Sanders was seated next to the fiercely anti-American leader during a discussion period that followed Sanders’s address.

After his brief remarks — the speech ran less than 15 minutes — Sanders told reporters that he was honored to be included by the Pontifical Academy of Social Sciences.

[Fact-checking the Democratic debate in N.Y.]

“The top 1 percent of people on this planet now own more wealth than the bottom 99 percent,” Sanders said, repeating messages used frequently in his campaign. “That, to me, is unacceptable, it is unsustainable, it is immoral, and together we have got to change that.”

The world already has the technology and the know-how to address some problems, such as climate change, Sanders said.

The invitation was unquestionably worth the time away from the American election, Sanders added. He made clear that he came largely because of the influence of Francis. The pontiff did not attend the conference but sent a letter of apology to the group.

Sanders’s campaign has said that the trip would be worthwhile even without an audience with Francis. The pope was leaving early Saturday for a trip to Greece to highlight the migrant crisis in Europe.

“I believe that the pope has played a historical and an incredible role in trying to create a new world economy and a new vision for the people of our planet,” Sanders told reporters.

“So when I received his invitation, yeah, I know it’s taking me away from the campaign trail for a day, but when I received this information, it was so moving to me that it was something that I could just simply not refuse.”

Sanders looked rattled when he was mobbed by Italian and other media at a gate to the Vatican. He glanced around with a worried expression as Secret Service agents struggled to hold the scrum back.

Sanders’s wife, Jane, reassured him as the agents formed a protective wedge around the couple.

Much of Sanders’s family accompanied him on the overnight flight from New York, including several grandchildren. His campaign manager and top strategist remained behind.

Sanders’s attendance at the academic conference, unusual in the middle of an election, also raised eyebrows at the Vatican. It set off a public spat between organizers and sponsors of the event.

“I know that Senator Sanders’s invitation at the workshop almost scandalized [people], but it’s customary for the Academy to invite people of different backgrounds, so this is far from being a novelty,” said Stefano Zamagni, a conference speaker who is a professor of political economy at the University of Bologna and a member of the steering committee of the academy.

Sanders’s remarks appeared to be well received.

It is novel to hear an American politician use the language and ideas of “the best of the culture of the European left,” said Stefano Fassina, an Italian politician who attended.

Clinton “is still a prisoner of the moderate liberalism that has dominated both the European and the American left in this last quarter of century,” Fassina said. “Sanders [offers] an alternative paradigm based on social justice and equality.”

Stefano Pitrelli in Rome and John Wagner in New York contributed to this report.