 -- Sen. John McCain, R-Ariz., slammed "half-baked, spurious nationalism" in an impassioned speech while accepting the Liberty Medal in Philadelphia this evening.

McCain, who was presented with the medal by former Vice President Joe Biden, began by saying he was humbled by the award before eventually lashing out at the nationalism that has swept the U.S. and warning against leaving the nation's place of prominence in the international community.

"To fear the world we have organized and led for three-quarters of a century, to abandon the ideals we have advanced around the globe, to refuse the obligations of international leadership and our duty to remain the last best hope of earth for the sake of some half-baked, spurious nationalism cooked up by people who would rather find scapegoats than solve problems is as unpatriotic as an attachment to any other tired dogma of the past that Americans consigned to the ash heap of history," McCain said, to applause.

"We live in a land made of ideals, not blood and soil," he continued. "... We have done great good in the world. That leadership has had its costs, but we have become incomparably powerful and wealthy as we did."

He added: "We have a moral obligation to continue in our just cause, and we would bring more than shame on ourselves if we don't. We will not thrive in a world where our leadership and ideals are absent. We wouldn't deserve to."

In introducing McCain, Biden praised his "courage and loyalty."

"I can think of no better description for the man we’re honoring tonight," Biden said.

McCain revealed in July that he had been diagnosed with brain cancer. He has clashed with President Donald Trump over Republicans' repeated attempts to repeal and replace Obamacare, including most recently when he said he could not "in good conscience" vote for the Graham-Cassidy bill. In response, Trump called McCain's opposition to the bill "terrible, honestly terrible."