John McCain. REUTERS/Charles Mostoller

Sen. John McCain of Arizona set rhetorical fire to what he called "half-baked, spurious nationalism" in a speech in Philadelphia.

McCain was there to accept the National Constitution Center's Liberty Medal, in recognition of his decades of service to the US. Former Vice President Joe Biden presented McCain with the honor on Monday evening.

McCain began his speech recounting his decadeslong friendship with Biden and his early years in politics, but he soon turned to a cautionary message on the state of political discourse.

"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," McCain said, as the audience erupted in a raucous applause, "is as unpatriotic as an attachment to any other tired dogma that Americans consigned to the ash heap of history."

"We live in a land made of ideals, not blood and soil," McCain said, alluding to a Nazi slogan.

"We have a moral obligation to continue in our just cause, and we would bring more than shame on ourselves if we don't," McCain continued.

Donald Trump. AP Photo/Pablo Martinez Monsivais

President Donald Trump's administration has pursued a nationalist-leaning agenda, seeking to toughen US immigration laws, implementing an aggressive travel ban targeting people from specific countries, and moving to dissociate the US from landmark international agreements like the Paris climate accord and the Iran nuclear deal.

That agenda was informed largely by Trump's former chief strategist, the far-right conservative figure Steve Bannon, who was kicked out of the administration in August. Bannon has since generated momentum in his push to declare war on establishment Republicans ahead of the 2018 midterm elections.

Nationalism has also manifested in unsettling ways outside government, as seen in Charlottesville, Virginia, this summer when a white nationalist rally turned deadly.

Trump's equivocations in response to violence there only fueled speculation that Trump was sympathetic to the white nationalists or white supremacists. His response invited fiery criticism from both Republicans and Democrats and dealt a significant blow to the president's approval ratings in the weeks that followed.

Watch John McCain's speech in full below: