Sen. John McCain (R-Ariz) at a Memorial Day ceremony on May 30 in Phoenix. (Ralph Freso/AP)

Sen. John McCain, who has shied away from criticizing Donald Trump even after the GOP presidential nominee questioned his military service last year, sharply criticized Trump on Monday for his handling of criticism from the parents of a Muslim Army captain who was killed in Iraq in 2004.

“He has suggested that the likes of their son should not be allowed in the United States — to say nothing of entering its service,” McCain (R-Ariz.) said in a lengthy statement issued by his Senate campaign Monday morning. “I cannot emphasize 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.”

The 2008 GOP presidential nominee praised Capt. Humayun Khan for his valor and sacrifice and thanked his parents, who spoke against Trump at the Democratic National Convention last week, for immigrating to the United States. “We’re a better country because of you,” he said.

McCain’s response is among the strongest from any major Republican leader to Trump’s remarks, which included questioning why Capt. Khan’s mother, Ghazala Khan, did not speak when she appeared alongside her husband, Khizr, last week in Philadelphia. Other GOP leaders — including House Speaker Paul D. Ryan (R-Wis.) and Senate Majority Leader Mitch McConnell (R-Ky.) — defended the Khans without mentioning Trump.

Trump last year questioned whether McCain, a former Navy pilot who spent five and a half years as a North Vietnamese prisoner, was indeed a war hero. “I like people who weren’t captured,” he said.

But McCain, who is locked in a difficult reelection campaign, largely brushed off the attack and has repeatedly pledged to support the GOP presidential nominee. In responding to the Khan controversy Monday, he went further than Ryan or McConnell, but he stopped well short of fully denouncing Trump and withdrawing his implicit endorsement.

“I challenge the nominee to set the example for what our country can and should represent,” he wrote. “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.”

McCain’s full statement:

The Republican Party I know and love is the party of Abraham Lincoln, Theodore Roosevelt, Dwight D. Eisenhower, and Ronald Reagan.

I wear a bracelet bearing the name of a fallen hero, Matthew Stanley, which his mother, Lynn, gave me in 2007, at a town hall meeting in Wolfeboro, New Hampshire. His memory and the memory of our great leaders deserve better from me.

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 emphasize 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.

Make no mistake: I do not valorize our military out of some unfamiliar instinct. I grew up in a military family, and have my own record of service, and have stayed closely engaged with our armed forces throughout my public career. In the American system, the military has value only inasmuch as it protects and defends the liberties of the people.

My father was a career naval officer, as was his father. For hundreds of years, every generation of McCains has served the United States in uniform.

My sons serve today, and I’m proud of them. My youngest served in the war that claimed Captain Khan’s life as well as in Afghanistan. I want them to be proud of me. I want to do the right thing by them and their comrades.

Humayun Khan did exactly that — and he did it for all the right reasons. This accomplished young man was not driven to service as a United States Army officer because he was compelled to by any material need. He was inspired as a young man by his reading of Thomas Jefferson — and he wanted to give back to the country that had taken him and his parents in as immigrants when he was only two years old.

Captain Khan’s death in Iraq, on June 8th, 2004, was a shining example of the valor and bravery inculcated into our military. When a suicide bomber accelerated his vehicle toward a facility with hundreds of American soldiers, Captain Khan ordered his subordinates away from the danger.

Then he ran toward it.

The suicide bomber, striking prematurely, claimed the life of Captain Khan — and Captain Khan, through his selfless action and sacrifice, saved the lives of hundreds of his brothers and sisters.

Scripture tells us that ‘Greater love hath no man than this, that a man lay down his life for his friends.’

Captain Humayun Khan of the United States Army showed in his final moments that he was filled and motivated by this love. His name will live forever in American memory, as an example of true American greatness.

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.

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.”