Politicians from both sides of the aisle and leaders from around the world remembered John McCain, the war hero turned leading Republican politician, after he died on Saturday in his Arizona home.

Mr. McCain, who had a malignant brain tumor that was discovered in 2017, was praised for his patriotism and defiance of party leaders. President Trump, with whom Mr. McCain had a yearslong, bitter feud, offered his “deepest sympathies and respect” to Mr. McCain’s family in a tweet on Saturday night.

Many praised Mr. McCain’s congressional career, which began after he was a prisoner of war in Vietnam, where he was tortured. He was elected to the House of Representatives in 1982, and the Senate in 1986, becoming known for his stances on campaign finance reform, immigration and foreign policy.

Cindy McCain, Mr. McCain’s wife, tweeted that her “heart is broken.”

“I am so lucky to have lived the adventure of loving this incredible man for 38 years,” she said, adding that he died “on his own terms.”