US senator John McCain has slammed Donald Trump for comments he made about the Muslim family of a fallen soldier, distancing himself and the GOP from the remarks. Trump had hit out after Khizr Khan, whose son Captain Humayun SM Khan was killed in Iraq in 2004, spoke at the Democrat Convention about Trump's attitude towards Muslims.

But Trump's response – which included accusing Khan and his wife Ghazala of 'viciously attacking' him – has prompted outrage in the US, and has caused many within the Republican Party to distance themselves from their candidate's comments.

In a statement, McCain said: "In recent days, Donald Trump disparaged a fallen soldier's parents. He has suggested that the likes of their son should not be allowed in the United States — to say nothing of entering its service. I cannot emphasise enough how deeply I disagree with Mr Trump's statement. I hope Americans understand that the remarks do not represent the views of our Republican Party, its officers, or candidates."

Trump had responded to Khan's speech in several different posts on social media, and said in a campaign statement: "Captain Humayun Khan was a hero to our country and we should honour all who have made the ultimate sacrifice to keep our country safe. The real problem here are the radical Islamic terrorists who killed him, and the efforts of these radicals to enter our country to do us further harm.

Trump, Khan
Donald Trump, Khizr Khan Getty Images

"Given the state of the world today, we have to know everything about those looking to enter our country, and given the state of chaos in some of these countries, that is impossible. While I feel deeply for the loss of his son, Mr Khan who has never met me, has no right to stand in front of millions of people and claim I have never read the Constitution, (which is false) and say many other inaccurate things. If I become President, I will make America safe again."

Trump also angered people by suggesting in a CNN interview that Khan's wife 'was probably not allowed to talk' as she stood by her husband during the speech without saying anything herself.

In the personal statement, McCain, who was the party's nominee in 2008, mentions his own family's military history and his personal connection to the armed forces.

"In the end, I am morally bound to speak only to the things that command my allegiance, and to which I have dedicated my life's work: the Republican Party, and more importantly, the United States of America. I will not refrain from doing my utmost by those lights simply because it may benefit others with whom I disagree," he said.

Arizona is watching

"I claim no moral superiority over Donald Trump. I have a long and well-known public and private record for which I will have to answer at the Final Judgment, and I repose my hope in the promise of mercy and the moderation of age. I challenge the nominee to set the example for what our country can and should represent.

"Arizona is watching. It is time for Donald Trump to set the example for our country and the future of the Republican Party. While our Party has bestowed upon him the nomination, it is not accompanied by unfettered license to defame those who are the best among us.

"Lastly, I'd like to say to Mr and Mrs Khan: thank you for immigrating to America. We're a better country because of you. And you are certainly right; your son was the best of America, and the memory of his sacrifice will make us a better nation – and he will never be forgotten."