Senator Bernie Sanders, in the midst of a contentious battle for the Democratic nomination, says he could not refuse an invitation to visit the Vatican and talk about the world economy and social justice — two issues at the core of his presidential campaign — even if it meant he would be out of the country for days leading up to Tuesday’s crucial primary in New York.

Just hours after debating Hillary Clinton in Brooklyn, Mr. Sanders will travel to Vatican City on Friday morning to deliver a 10-minute speech at a conference hosted by the Pontifical Academy of Social Sciences, a scholarly association that was established by Pope John Paul II in 1994.

Mr. Sanders insists the visit is not a political maneuver and that he was inspired to make the trip by Pope Francis’ message of caring for others and combating economic inequality. Others, however, say Mr. Sanders is not only seeking to discuss issues, but is also driven by a desire to be seen as a global leader on issues of social justice.

Mr. Sanders said in an interview on Thursday that he thought Francis has played “an extraordinary role, and with great courage” in getting the world to think more about the “moral economy and how we have to deal with economic and environmental and social injustice.”