Vatican City (AFP) - Pope Francis has questioned Donald Trump's Christian faith over his vow to build a border wall to keep out immigrants, sparking a backlash from the Republican presidential candidate.

"Anyone, whoever he is, who only wants to build walls and not bridges is not a Christian," the pontiff told journalists Thursday during his return journey from a trip to Mexico.

He was responding to a question about the billionaire's anti-immigrant stance.

"Vote, don't vote, I won't meddle. But I simply say, if he says these things, this man is not a Christian," Francis said.

"We need to see if he really said them and for this I will give him the benefit of the doubt."

After initially launching into an audacious denunciation of Francis, Trump later softened his tone dramatically.

"For a religious leader to question a person's faith is disgraceful," Trump said in a statement delivered on a campaign stop in South Carolina, which holds its Republican primary this weekend.

But hours later, at a townhall event, the real estate tycoon heaped praise on the pontiff.

"Oh, the pope is a wonderful guy," Trump said, suggesting the media had hyped and exaggerated the tone of his earlier statement.

"I have a lot of respect for the pope. I think he's got a lot of personality, he's very different, a great guy, and I think he's doing a very good job, he has a lot of energy."

Trump said the pontiff was misinformed, unaware of the impact of the drugs coming into the United States and a range of security issues that make it necessary to build a wall.

The leading Republican presidential candidate also said he would welcome an opportunity to meet the pope.

Trump has gained popularity by claiming Mexico is sending criminals to the United States, and last week he accused the pope of visiting the border between the two countries at the bidding of the Mexican government.

Francis was speaking after concluding a five-day trip to Mexico, where he delivered a mass before 300,000 people near the US border and decried the "human tragedy" of migrants fleeing violence worldwide.

Story continues

In a highly symbolic gesture, the pontiff climbed a ramp facing the Rio Grande and looked out across the border into US territory, where hundreds of migrants waved at him.

Trump has vowed to build a wall on the US southern border to keep migrants from illegally crossing into the United States, a pledge that has caused a firestorm in the presidential campaign where immigration is a hot-button issue.

"If and when the Vatican is attacked by ISIS, which as everyone knows is ISIS's ultimate trophy, I can promise you that the pope would have only wished and prayed that Donald Trump would have been president because this would not have happened," Trump said.

- 'Pope used as pawn' -

Propagandists for ISIS -- one of several names for the Islamic State extremist group that controls swathes of Syria and Iraq -- have issued threats that their fighters will plant their flag on the top of St Peter's basilica.

But Italian officials have insisted they have no knowledge of any credible threat to the Vatican or the pope.

Trump said Mexican authorities had told the pope only "one side of the story."

"He didn't see the crime, the drug trafficking and the negative economic impact the current policies have on the United States.

"They are using the pope as a pawn and they should be ashamed of themselves for doing so, especially when so many lives are involved and when illegal immigration is so rampant."

It was not the first time Trump had issued the pawn jibe, and Francis was asked about it on the plane.

"Am I a pawn of the Mexican government? I leave that to your judgement, to the people to judge," he said.

The 79-year-old Argentine, a fervent critic of the freewheeling capitalism espoused by Trump, also said he was proud to have been branded a politicized pontiff by the tycoon.

"Thanks be to God if that is what he said, because Aristotle defined man as a political animal: at least (it means) I am a human person," the pope said.

Trump has promised to end illegal immigration by building a wall along the Mexican border, which stretches more than 3,100 kilometers (1,950 miles) -- a third of it currently covered by high-security fencing.

One of Trump's Republican rivals, former Florida governor Jeb Bush, was charitable towards him in remarks addressing the contretemps.

"I don't question anybody's Christianity, because I honestly believe that's a relationship you have with your creator," Bush, a devout Catholic, told reporters.

Speaking of building a wall and other forms of border control, he added: "That's not an un-Christian thing to do, to make sure people don't come across our border illegally. That's a just thing to do."