Khizr Khan at the DNC
Khizr Khan offers to loan his copy of the Constitution to Republican US presidential nominee Donald Trump, as he speaks during the last night of the Democratic National Convention Mike Segar/Reuters

Republican presidential candidate Donald Trump has responded to a speech by the Muslim father of an American soldier killed in Iraq, calling it a "vicious attack".

Khizr Khan, who was born in Pakistan and moved to the US, spoke at the Democrat Convention in Philadelphia, telling the audience his son had given his life for the US, but would not have been allowed into the country if Trump's Muslim ban had been in place.

Responding to the powerful speech on Twitter, Trump wrote: "Captain Khan, killed 12 years ago, was a hero, but this is about RADICAL ISLAMIC TERROR and the weakness of our "leaders" to eradicate it!"

During his speech, Khan got out a copy of the Constitution, and said: "Donald Trump, you are asking Americans to trust you with their future. Let me ask you: Have you even read the United States Constitution? I will gladly lend you my copy.

"In this document, look for the words liberty and equal protection of law. Have you ever been to Arlington Cemetery? Go look at the graves of brave patriots who died defending [the] United States of America. You'll see, all faiths, genders and ethnicities. You have sacrificed nothing and no one."

Captain Humayun S. M. Khan died in Iraq in 2004 and was posthumously awarded the bronze star and the purple heart for saving the lives of other soldiers when he was killed in a suicide bomb attack on his unit.

Coming under fire for tweeting about Khan following the speech, Trump added: "I was viciously attacked by Mr Khan at the Democratic convention. Am I not allowed to respond? Hillary voted for the Iraq war, not me!"

He went on to add that the media was fawning over the Democrat convention, referring to them as dishonest in a further series of tweets.