Rex Tillerson, the former secretary of state, warned on Wednesday that America had plunged into a “crisis of ethics and integrity in our society and among our leaders” that could set the country down “a pathway to relinquishing our freedom”.

Tillerson, who was dismissed in March by Donald Trump, did not name the president. But his remarks, before a graduating class at the Virginia Military Institute in Lexington were largely seen as directed at the Trump administration.

“If our leaders seek to conceal the truth, or we as people become accepting of alternative realities that are no longer grounded in facts, then we as American citizens are on a pathway to relinquishing our freedom,” Tillerson said.

“A responsibility of every American citizen to each other is to preserve and protect our freedom by recognizing what truth is and is not, what a fact is and is not, and to begin by holding ourselves accountable to truthfulness and demand our pursuit of America’s future be fact-based, not based on wishful thinking, not hoped-for outcomes made in shallow promises, but with a clear-eyed view of the facts as they are and guided by the truth that will set us free to seek solutions to our most daunting challenges.”

If we do not confront the crisis of ethics and integrity in our society, democracy as we know it is entering its twilight years Rex Tillerson

Trump has presented himself as a defender of the truth, having invented and popularized the phrase “fake news”, by which he means news that is bad for him.

But the president has been repeatedly exposed as an habitual liar prone to exaggerating the size of his crowds, his fortune and his popularity; given to denials of acquaintances, deals and relationships; and offering changing and contradictory descriptions of his own actions and motivations and those of people around him.

Tillerson’s address to the military school was scheduled before he was removed as secretary of state. Upon Tillerson’s departure, Trump praised him by saying: “I very much appreciate his commitment and his service and I wish him well. He’s a good man.”

But Trump admitted that he and Tillerson “disagreed on things”, including the Iran nuclear deal, which Tillerson wished to stay in, and the 2017 blockade of Qatar by Saudi Arabia, which Tillerson criticized and Trump supported. “We were not really thinking the same,” Trump said.

Ironically, Tillerson was an early advocate of making diplomatic overtures to North Korea, prompting Trump to tweet last year, “he is wasting his time trying to negotiate with Little Rocket Man”.

Such clashes may have fed the concerns Tillerson aired on Wednesday, in a speech that warned that the United States must never take its “long-held allies for granted, both in trading relations and in national security matters”.

Tillerson’s most powerful theme, however, was the importance of standing up for the truth.

“When we as a people, a free people, go wobbly on the truth, even on what may seem the most trivial of matters, we go wobbly on America,” he said. “If we do not as Americans confront the crisis of ethics and integrity in our society and among our leaders in both the public and private sector, and regrettably at times into the nonprofit sector, then American democracy as we know it is entering its twilight years.”

Tillerson, the former chief executive of ExxonMobil, has largely avoided the spotlight since leaving government. His tenure as secretary of state was criticized for his perceived aloofness, his failure to fill rank-and-file jobs and his failure to maintain the alliances he touted in his speech.

In October 2017, Tillerson denied that he had considered resigning over a news report that he had called the president a “moron” – but he did not deny calling Trump that.

Tillerson was succeeded in the secretary of state job by Mike Pompeo, who ended Tillerson’s hiring freeze and said he wanted to give the department its “swagger” back.

In excerpts of a pep talk for staff, Pompeo said: “Swagger is not arrogance; it is not boastfulness, it is not ego. No, swagger is confidence; in one’s self, in one’s ideas. In our case, it is America’s essential rightness.”