In his final national security address, on the subject of counterterrorism, President Obama delivered a powerful and inspiring message about the character of our nation that our next president would do well to heed.

While President-elect Donald Trump has been busy provoking international tensions via Twitter, our current president continues to set the example for grace and inspiration in a world leader.

For most of his address at MacDill Air Force Base, President Obama soberly and realistically discussed the successes and challenges we face in fighting terrorism, but, in the final portion of the speech that he heartrendingly called his “final words” as Commander-in-Chief, he laid out the challenges our democracy faces from within.

In urging vigilant protection of the very character of our nation, he perfectly embodied everything we should want our leader to be.

So let my final words to you, as your Commander-in-Chief, be a reminder of what it is that you are fighting for, what it is that we are fighting for. The United States of America is not a country that imposes religious tests as a price for freedom. We’re a country that was founded so that people could practice their faiths as they choose. The United States of America is not a place where some citizens have to withstand greater scrutiny, or carry a special I.D. Card, or prove that they are not an enemy from within. We are a country that has bled and struggled and sacrificed against that kind of discrimination and arbitrary rule, here in our own country and around the world.

We’re a nation that believes freedom can never be taken for granted, and that each of us has a responsibility to sustain it. The universal right to speak your mind and to protest against authority. To live in a society that’s open and free. That can criticize our president without retribution. A country where you’re judged by the content of your character, rather than what you look like, or how you worship, or what your last name is, or where your family came from. That’s what separates us from tyrants and terrorists.

We are a nation that stands for the rule of law, and strengthened the laws of war. When the Nazis were defeated, we put them on trial. Some couldn’t understand that. It had never happened before. But as one of the American lawyers who was at Nuremberg said, “I was trying to prove that the rule of law should govern human behavior,” and by doing so, we broadened the scope and reach of justice around the world. Held ourselves out as a beacon and an example for others.

We are a nation that won world wars without grabbing the resources of those we defeated. We helped them rebuild. We didn’t hold on to territory, other than the cemeteries where we buried our dead. Our greatest generation fought and bled and died to build an international order of laws and institutions that could preserve the peace, and extend prosperity and promote cooperation among nations. And for all of its imperfections, we depend on that international order to protect our own freedom.

In other words, we are a nation that, at our best, has been defined by hope and not fear. A country that went through the crucible of a civil war to offer a new birth of freedom, that stormed the beaches of Normandy, climbed the hills of Iwo Jima, that saw normal people mobilize to extend the freedom of civil rights. That’s what makes us who we are. It makes us stronger than any act of terror.

Remember that history. Remember what that flag stands for. For we depend on you. The heirs to that legacy. Our men and women in uniform, and the citizens who support you, to carry forward what is best in us, that commitment to a common creed, the confidence that right makes might, not the other way around.

That valediction to the troops at MacDill, as moving as it was, also has something of an ominous quality. Without naming Trump, Obama ticked through a list of the threats to our nation’s character that Trump’s words and actions may invoke.

Just as Obama has tried to be a guiding hand to his successor during this transition, he seemed to be laying out a different path for Trump in this speech — and setting an example that we can only hope and pray Trump follows.