Americans should be forgiven if we worry just a little about the state of our country as we move on past the 237th anniversary of the Declaration of Independence. From the crippling political stalemate in Washington to the economic struggles of lower- and middle-income citizens to the sea of troubles we face overseas, this is a deeply challenging time for the United States. And in important ways, the way even domestic issues play out can affect our standing abroad.

Last week’s historic Supreme Court decision to advance same-sex marriage rights provides a more optimistic counterpoint to the nation’s troubles. It portrays the unique American experiment in liberty as still moving forward and still succeeding. Our core national mission has always been the promise of individual liberty for all our citizens. On a leading civil rights issue of our time, the court acted not to curb individual rights but to reaffirm and expand them.

This American pursuit of liberty was a core theme of Jon Meacham’s recent book, “Thomas Jefferson and the Art of Power.” Meacham chronicled Jefferson’s central role in creating the very first country devoted to liberty. He emphasized that, in the years following the republic’s founding, Jefferson feared a return to the rule of the few or even monarchy. Jefferson believed that America must become instead, an “Empire of Liberty” both at home and around the world. This stood in sharp contrast, of course, to his failure to address the most urgent moral issue of his time — slavery and the rights of African-Americans.

That struggle to overcome what former Secretary of State Condoleezza Rice has called “America’s original sin” is far from finished. That is why last week’s historic Supreme Court decision to strike down parts of the Voting Rights Act of 1965 was so disappointing.

The court decision merits special reflection, as this year is the sesquicentennial of Lincoln’s Emancipation Proclamation and the epic Battle of Gettysburg on July 1-3, 1863 — the key fight that effectively ended the Confederacy’s hope that its rebellion against the Union would succeed. It took another long century after Gettysburg to redeem the promise of liberty to African-Americans in the Civil Rights Act of 1964 and the next year’s Voting Rights Act. But, nearly 50 years later, African-Americans and other minorities are, in some parts of the country, still denied full and fair access to the ballot box. The court’s 5-4 ruling erred in not recognizing this persistent limitation on equality and rights for all of our citizens.

The battle for liberty is far from finished in the United States. In our time, that means extending full equality to African-Americans, women and the gay and lesbian community.

July 4 reminds us that, despite our imperfections, our greatest strength is our continued commitment to liberty. It is the central story of our history. That is why we are still the indispensable advocate for freedom in the world today and the measure by which all other nations are judged. China and Russia, by contrast, will never be great so long as they deny basic human and religious rights to their own citizens. Millions of immigrants are not pressing to cross their borders as they are ours to find the blessings of a free life. Their denial to their own people of essential civil freedoms is their greatest weakness — and their greatest future vulnerability. America is the far more appealing country because our democracy rests on the solid promise of freedom and equality enshrined most brilliantly in the Declaration of Independence.

We can be true to Lincoln’s belief in America as humanity’s “last best hope of earth” and to Martin Luther King’s magnificent dream by reaffirming our determination to advance liberty for all our citizens and billions more people around the world. That is, and has always been, the great promise of our Declaration of Independence.

Nicholas Burns is a professor of the practice of diplomacy and international politics at Harvard’s Kennedy School of Government.