Here to salute the 4th of July are a few troubled thoughts on patriotism.

Orestes Brownson, the most prominent American Catholic public intellectual of the 19th century, discerned a divinely bestowed mission for the United States, exceeding even the historic roles of the ancient Greek and Roman republics.

Here is how he put it in his book “The American Republic”:

“The Greek and Roman republics asserted the state to the detriment of individual freedom; modern republics either do the same or assert individual freedom to the detriment of the state. The American republic has been instituted by Providence to realize the freedom of each with advantage to the other.”

Brownson wrote that somewhat over-the-top panegyric in 1866, one year after the close of a Civil War that tested the endurance of the nation in the face of the Confederate States’ attempt to secede from the Union.

What a difference 158 years make! Lately, we’ve had a movie called “Civil War,” about a successful national uprising, to remind us that Americans can’t take political and social stability for granted. And also perhaps inadvertently making the point that, along with much else, contemporary America needs a revival of patriotism, a virtue that in an earlier day came naturally to someone like Orestes Brownson.

Let’s understand, though, that true patriotism isn’t nationalism. In his first encyclical, Redemptor Hominis (“The Redeemer of Man”), published in 1979, St. Pope John Paul II listed “exaggerated nationalism instead of genuine love of country” among the several varieties of “selfishness” that he saw threatening social harmony in many places then — and, I venture to say, would also find today if he returned for another look.

But if patriotism isn’t nationalism, what is it? St. Thomas Aquinas gives what at first may seem a strange answer. He considers patriotism under the heading of piety, a virtue that to the medieval mind apparently meant something of far more generous scope than the word implies today.

Patriotism for Aquinas is interpersonal. After God, he wrote, a human being is a “debtor chiefly to his parents and his country.” In this view, patriotism does not dispose us to love “country” as a political and sociological abstraction but to appreciate — and treat accordingly — our fellow citizens, especially those engaged in some way in governing or guarding the nation or contributing to its flourishing. And although some officeholders are incompetent, philosopher Josef Pieper points out that, except for extreme cases, Aquinas considers it right to honor even them insofar as the honor is directed to their office rather than their incompetent selves.

Still, someone seeking to promote patriotism faces a fundamental problem today. In his acclaimed book “After Virtue” (University of Notre Dame Press, $35), Alasdair MacIntyre pointed to twin roadblocks that stand in the way of the practice of patriotism now: “When the relationship of government to the moral community is put in question by the changed nature of government and the lack of moral consensus in the society, it becomes difficult any longer to have any clear, simple and teachable conception of patriotism.” He concluded on the grim note that all versions of modern politics — “liberal, conservative, radical or socialistic” — are unsatisfactory from the perspective of the virtue tradition because “modern politics itself expresses in its institutional forms a systematic rejection of that tradition.”

We’ve come a long way since Brownson’s day. Few people now would feel at home, as he did, with the idea that America has a special role in God’s providential plan. And that’s worth pondering this July 4.