Media playback is unsupported on your device Media caption Pope Francis has questioned US Republican presidential candidate Donald Trump's Christianity

The Pope has questioned US Republican presidential candidate Donald Trump's Christianity over his call to build a border wall with Mexico.

Pope Francis said "a person who thinks only about building walls... and not of building bridges, is not Christian".

The New York businessman supports deporting nearly 11 million undocumented immigrants.

Calling himself a "proud Christian", Mr Trump blamed Mexico for the Pope's remarks, calling them "disgraceful".

Mr Trump has alleged that Mexico sends "rapists" and criminals to the US.

Pope Francis made the comments at the end of a six-day trip to Mexico.

"A person who thinks only about building walls, wherever they may be, and not of building bridges, is not Christian. This is not the gospel," he said.

Media playback is unsupported on your device Media caption Donald Trump is not happy that Pope Francis has questioned his Christianity

He declined to say whether Americans should vote for Mr Trump, who is leading the Republican race for president.

"I say only that this man is not Christian if he has said things like that. We must see if he said things in that way and I will give him the benefit of the doubt," the Pope said.

In response to a question about whether contraception was allowed to prevent the transmission of the Zika virus, the Pope said that for some cases the "lesser of two evils" can be used. He said abortion "is a crime, an absolute evil," but that avoiding pregnancy is not.

Addressing a rally in South Carolina, Mr Trump responded to the Pope's comments.

"For a religious leader to question a person's faith is disgraceful. I am proud to be a Christian," Mr Trump said. "No leader, especially a religious leader, should have the right to question another man's religion or faith."

"[The pope] said negative things about me. Because the Mexican government convinced him that Trump is not a good guy," he said.

Analysis - Jon Sopel, North America editor

Did Mr Trump need to take on the Pope? Well, almost certainly yes.

Because in god-fearing South Carolina, the next state to vote in the primary process - to have the Pope say that he is unchristian is potentially very damaging.

And over the course of the campaign, the billionaire property developer has been at pains to prove his religious credentials, appearing at rallies with a copy of the Bible that his mother had given him as a child

Trump v Pope... who wins?

He also said the Vatican was the so-called Islamic State group's "ultimate trophy" and that if it attacked, "the Pope would have only wished and prayed that Donald Trump would have been president because this would not have happened".

Two of Mr Trump's Republican rivals, Marco Rubio and Jeb Bush, both Catholics, said they look to the Pope for spiritual guidance, not political direction.

Mr Rubio said the US has a right and an obligation to control its borders.

Mr Bush told reporters he "supports walls where it's appropriate" and that "Christianity is between he and his creator. I don't think we need to discuss that".

Jerry Falwell Jr, the president of the conservative Christian Liberty University and a Trump supporter, told CNN that the Pope had gone too far.

"Jesus never intended to give instructions to political leaders on how to run a country," he said.

Image copyright Twitter Image caption Trump supporters on social media pointed out that the Vatican has walls

Earlier this month, Mr Trump called Pope Francis "a very political person" in an interview with Fox News.

"I don't think he understands the danger of the open border we have with Mexico," Mr Trump said.

American Catholics are seen as an important voting bloc in US elections. Many support Republican candidates because of their opposition to abortion and gay marriage.

Mr Trump has been courting the evangelical Christian vote, often successfully, but his fellow Republican rivals have tried to argue that his religiosity is not sincere.

Trump's religious views: In his own words

Image copyright Instagram Image caption Donald Trump was raised as a Presbyterian

"I'm going to protect Christians" (January 2016)

"I think if I do something wrong, I think, I just try and make it right. I don't bring God into that picture. I don't" ( July 2015)

"I believe in God. I am Christian. I think The Bible is certainly, it is the book...I'm a Protestant, I'm a Presbyterian. And you know I've had a good relationship with the church over the years. I think religion is a wonderful thing. I think my religion is a wonderful religion." (2011)

His proposed Muslim ban: "Until we are able to determine and understand this problem and the dangerous threat it poses, our country cannot be the victims of horrendous attacks by people that believe only in Jihad, and have no sense of reason or respect for human life." (December 2015)

Muslims in general: "Most Muslims are wonderful people, but is there a Muslim problem? Look what's happening. Look what happened right here in my city with the World Trade Center and lots of other places." (2011)

Ted Cruz's campaign is now running an advertisement featuring a 1999 television interview Mr Trump gave in which he said he was "very pro-choice" when it comes to abortion.

In January, Mr Trump faced ridicule after flubbing a Bible verse when giving a speech to a Christian university in Virginia.

He has said he is a Presbyterian Christian but has had trouble recalling his favourite Bible verse when asked.

He has referred to communion, the Christian sacrament signifying Jesus' last supper, as having "the little wine" and "the little cracker."

Donald Trump: In-depth

Media playback is unsupported on your device Media caption Three things Trump says

22 things that Donald Trump believes - What are his policies and beliefs?

What would a Donald Trump presidency be like? - Anthony Zurcher imagines a Trump White House

Donald Trump and the politics of paranoia - He is just the latest example of a tendency in US politics that goes back centuries

Trump turns notoriety into a win - After New Hampshire, is Mr Trump unstoppable?