Here's how the fight between Pope Francis and Republican presidential candidate Donald Trump is playing out. (Sarah Parnass/The Washington Post)

First was the British prime minister, who called Donald Trump “divisive, stupid and wrong.” Then came Britain’s Parliament, which denounced him with colorful language. The French prime minister, the Turkish president and a Saudi prince also weighed in: The Republican presidential front-runner, they agreed, was a demagogue disgracing the United States.

On Thursday, Pope Francis added the strongest voice yet to a growing chorus of world leaders taking a stand against the celebrity candidate — condemning Trump’s hard-line immigration agenda and suggesting he was not a Christian because of it.

As the pontiff took the rare step of injecting his views into the U.S. campaign, his remarks underscored the anxiety coursing through world capitals about a possible Trump presidency. Francis noted Trump’s promise to deport an estimated 11 million undocumented immigrants living in the United States illegally and make Mexico pay for a wall along the border to keep them out.

“A person who thinks only about building walls — wherever they may be — and not building bridges, is not Christian,” Francis told reporters Thursday aboard the papal plane as he returned to Rome from a visit to Mexico, according to a translation from the Associated Press.

“This is not in the Gospel,” he added.

Trump just won South Carolina. These charts show how huge that is.

The pontiff’s remarks jolted the Republican contest just two days before the crucial South Carolina primary, immediately overshadowing the closing arguments the top candidates were making on the campaign trail.

Trump, a Presbyterian, strongly rebuked Francis for his comments, seeking to gain the upper hand politically in a state where polls show him with a double-digit lead.

“For a religious leader to question a person’s faith is disgraceful,” Trump said at a campaign rally in Kiawah Island. “I’m proud to be a Christian, and as president I will not allow Christianity to be consistently attacked and weakened, unlike what is happening now with our current president.”

Trump’s immigration positions have been at the core of the billionaire mogul’s emotional and nativist pitch to voters — and many of his supporters rallied to the candidate’s defense in the face of the pontiff’s criticism.

As Trump sat down for lunch at Fratello’s Italian Tavern in North Charleston, Mayor R. Keith Summey reassured the candidate.

“I don’t care if he’s the pope or not, you know, the bottom line is: Your faith is your faith,” said Summey, who had just endorsed Trump. “I’m a Baptist, but I think there are some darn good Catholics and darn good Jews, a lot of good people out there in this country, and just because I say something they disagree with doesn’t mean that I have any less faith than they have.”

Ahead of Saturday’s Republican primary in South Carolina, the latest polling indicates a majority of evangelical voters back Donald Trump, yet remain bitterly divided as many question his stance on social issues ranging from abortion to gay marriage. (Dalton Bennett/The Washington Post)

Trump listened as the mayor spoke, pressing his lips together tightly, and then said, “It’s a very sad situation.” Though minutes later, Trump told reporters he remained “totally respectful” of the pope.

For Trump, who had been spending the week on the defensive over his dramatic changes on social issues, Francis’s comments helped him redirect attention to immigration. There also were potential long-term risks for Trump’s candidacy, however, considering the pontiff’s wide popularity across the country and the respect he commands.

“The pope was in Mexico,” he said at his rally. “Do you know that? Does everyone know that? He said negative things about me because the Mexican government convinced him that Trump is not a good guy because I want to have a strong border, I want to stop illegal immigration, I want to stop people from being killed.”

For generations, the role of the papacy has been shaded by politics — and Francis’s papacy especially, with his efforts on global climate change and general outspokenness. But it was striking for him to comment on U.S. electoral politics during a campaign.

“He has a general duty to remind us of our Christian obligations, but attaching them to politically partisan proposals is unwise,” said John O’Sullivan, a historian of papal politics and the president of the Danube Institute in Budapest. “ One has to question these off-the-cuff remarks that make the pope look like someone who’s grinding an ax.”

Francis’s commentary was the latest evidence of intense global interest in the 2016 presidential campaign — especially Trump’s unpredictable candidacy.

“The presidential campaign here is of intense interest to the entire world, in no small part because people and countries everywhere will be affected by our choice,” said Richard Haass, president of the Council on Foreign Relations.

Last month in London, after Trump proposed temporarily banning all Muslims from entering the United States, members of Parliament debated whether to ban Trump from traveling to the United Kingdom. In the House of Commons, lawmakers described him with a flurry of insults: an “idiot,” a “buffoon,” a “demagogue” and a “wazzock.”

British Prime Minister David Cameron had earlier called Trump’s travel ban on Muslims “divisive, stupid and wrong.” And London Mayor Boris Johnson said that Trump was “out of his mind” and “unfit” to be president.

“The only reason I wouldn’t visit some parts of New York is the real risk of meeting Donald Trump,” Johnson said.

Similar condemnations have rained down from around the globe. French Prime Minister Manuel Vals has accused Trump of “feeding hatred and misinformation.” Turkish President Recep Tayyip Erdogan has said of Trump’s Muslim ban that a “politician shouldn’t talk like this.” And Saudi Prince Alwaleed bin Talal took to Twitter to call Trump a “disgrace to America.”

In South Carolina, however, Trump’s “politically incorrect” statements and policy pronouncements have propelled him to the pole position heading into Saturday’s primary. Many of his supporters on Thursday scoffed at the pope’s comments.

Pam Ridgway, a 64-year-old retired teacher from North Charleston who saw Trump eat lunch, said she was “really surprised” by the pope’s comments.

“You can’t have a country unless you have borders, and evidentially we can’t have borders if we don’t have the wall because we’re not taking very good care of our borders,” said Ridgway, who said she plans to vote for Trump. “And I think he’s a Christian, if he says he is.”

Later in the day at a Trump rally event in Gaffney, Walter Lansford of Boiling Springs said that “Trump’s right” in the spat with the pope.

“Even the liberals that we talk to, they’re liberal to a point. They’re willing to let 13 million illegals stay here, but they don’t want 150 million more to come,” said Lansford, 69. “So the pope has his opinion, Trump has his. I don’t have a problem, I just support everything Trump has said so far.”

Most of the other Republican candidates handled Trump’s clash with Francis cautiously, giving a series of non-answers that revealed their fear of inflaming either side, considering that the political ramifications of the dispute were not immediately obvious.

Sen. Ted Cruz of Texas said in Easley, “That’s between Donald and the pope. I’m not going to get in the middle of that, and I’ll leave it to the two of them to work out.”

Without directly responding to Francis’s remarks, Sen. Marco Rubio (Fla.) said the United States is a sovereign country that has “a right to control who comes in, when they come in and how they come in.”

“Vatican City controls who comes in, when they come in and how they come in as a city-state,” Rubio, who is Catholic, said during a stop in Anderson.

Campaigning in Columbia, former Florida governor Jeb Bush, who is also Catholic, said it was improper for the Holy Father to question Trump’s faith.

“I think his Christianity is between him and his Creator,” Bush told reporters. “I don’t think we need to discuss that.”

Ohio Gov. John Kasich took a different approach, however, heaping praise on Francis when asked about the pope’s Trump critique.

“I love the pope,” Kasich said following a campaign event in Clemson. “The pope, in terms of his overall message has been one of love and compassion. . . . I’m not even sure I’m qualified to criticize or comment on remarks from this man.”

Rucker reported from Columbia, S.C. James Hohmann in Clemson, Ed O’Keefe in Columbia, Sean Sullivan in Easley, Jose A. DelReal in Gaffney, Katie Zezima in Anderson and Adam Taylor in Washington contributed to this report.