WEST POINT, N.Y. — President Trump, whose recent moves to politicize the armed forces have drawn sharp condemnations from revered former officers, delivered a paean to the military's historical traditions and values here Saturday at the nation's premier officer training academy.

Giving the commencement address at the U.S. Military Academy at West Point, Trump used the pageantry of 1,100 graduating cadets wearing gray-and-white dress uniforms and seated in social-distanced formation as his backdrop to try to turn the page on his season of turmoil.

The president also tried to look past his own campaign to erode public trust in the Justice Department, the free press and other U.S. institutions when he celebrated the enduring strength and gallantry of another institution: the military.

“What has historically made America unique is the durability of its institutions against the passions and prejudices of the moment,” Trump said. “When times are turbulent, when the road is rough, what matters most is that which is permanent, timeless, enduring and eternal.”

Trump’s visit to West Point was freighted with controversy. More than 700 alumni signed a public letter to the Class of 2020 that was an unmistakable rebuke of Trump’s threat “to use the military as a weapon against fellow Americans” protesting racial injustice. The signatories also appeared to indirectly condemn Defense Secretary Mark T. Esper, a West Point graduate, who accompanied Trump in a June 1 church photo opportunity after military police helped forcibly clear peaceful protesters from Lafayette Square in Washington, D.C.

“When fellow graduates fail to respect the checks and balances of government, promote individual power above country, or prize loyalty to individuals over the ideals expressed in the Constitution, it is a travesty to their oath of office,” the letter read.

Louis E. Caldera, also a West Point graduate and former Army secretary, wrote in his own open letter to graduates that they were taught to “take care of your troops” but alleged that Trump takes “unnecessary risks with your lives.”

“This president has destroyed the reputations and careers of countless public servants, ambassadors, military officers and civilian alike, demoralizing and depleting the ranks of government and reducing its effectiveness,” Caldera wrote. “To use and abuse people in this narcissistic and unprincipled manner is the antithesis of leadership that inspires loyalty and devotion among those you are privileged to lead.”

There were no direct references at Saturday’s ceremony to the escalating quarrel between Trump and military leaders, including several former Joint Chiefs of Staff chairmen as well as Trump’s first defense secretary, Jim Mattis, a revered retired Marine Corps general.

Trump did, however, thank members of the National Guard for responding “with precision to so many recent challenges” and for fighting to uphold “constitutional rule of law,” a clear reference to the domestic protests in the wake of George Floyd’s death in Minneapolis police custody last month.

The West Point ceremony was awash in pomp and circumstance, complete with cannon blasts, although as a consequence of the coronavirus pandemic it lacked the crackling energy of typical commencements. The graduates sat in folding chairs arrayed six feet apart on an open field. There was only a smattering of guests, as family and friends watched the proceedings via live stream from home.

The cadets, who had been dismissed from campus in March when much of the country shut down over the coronavirus, were brought back to campus several weeks ago for the commencement and went through a rigorous testing and quarantine regimen to ensure their safety.

Trump briefly brought up the pandemic in his remarks. He singled out China as the virus’s origin and vowed, “We will vanquish the virus. We will extinguish this plague.”

Trump also spoke generally about his worldview and committed to reshape America’s role around the globe.

“We are ending the era of endless wars,” he said. “It is not the duty of U.S. troops to solve ancient conflicts in faraway lands that many people have never heard of. We are not the policemen of the world. But let our enemies be on notice: If our people are threatened, we will never, ever hesitate to act. And when we fight, from now on, we will only fight to win.”

Trump, who attended a military high school but deferred service in the Vietnam War citing bone spurs, has tried as president to use his role as commander in chief to his political advantage by appearing regularly with uniformed troops. He often speaks admiringly and graphically about the sacrifices of U.S. forces. On Saturday, he celebrated the “mighty forces who sent tyrants, terrorists and sadistic monsters running scared through the gates of hell.”

Trump was visibly moved by the opportunity to speak at West Point, something many past presidents have done. Before taking the stage, he paused, along with Lt. Gen. Darryl A. Williams, the academy’s superintendent, to observe a statue of the late general Douglas MacArthur, a hero of Trump’s.

“Few words in the English language and few places in history have commanded as much awe and admiration as West Point,” Trump said. “This premier military academy produces only the best of the best — the strongest of the strong — and the bravest of the brave. West Point is a universal symbol of American gallantry, loyalty, devotion, discipline, and great skill.”