"To the thousands of moms and dads and grandparents and family members beaming with joy: thank you for raising rock-ribbed, American patriots," Trump said, generating loud cheers.
"You are the ones who will invent and define the next generation of air warfare," Trump said to the class of nearly 1,000 cadets who earned the rank of second lieutenant. "You'll win so much you're gonna get tired of winning," Trump ad-libbed.
But he got some of his strongest applause when said he would shake each graduate's hand. "They gave me a choice, they said: 'Sir, you don't have to shake any hands.' Some people do that ...'You can shake the one hand, the top of the class. You can shake 10, 50, or 100. Or you could also stay for 1,000,'" he continued. "And I'm staying for 1,000." Trump said and the crowd roared in response.
He did as promised, for more than an hour, saluting each cadet before giving a firm handshake, at one point shaking his hand in mock pain.
Trump recognized certain cadets for academic and athletic excellence, including two who earned Rhodes Scholarships and another two who won an air rifle championship. But when he got to a cadet who won a college home run derby, Trump spontaneously summoned him to the stage.
"I want to feel this guy's muscles," Trump joked, squeezing the cadet's arm.
Many of the cadets will go on to become pilots of traditional and remotely-piloted aircraft. Amid a push to increase diversity in the Air Force, a quarter of the graduates are women, and nearly one-third are non-white.
The Pentagon's annual review of sexual assault at the military academies found that during the 2017-2018 academic year the academies received a total of 117 unrestricted and restricted reports of sexual assault involving cadets and midshipmen at the U.S. Military Academy, the U.S. Air Force Academy and the U.S. Naval Academy, compared with 112 last year.
However, unlike the other military academies which saw an increase, The U.S. Air Force Academy reported a decrease in reported sexual assaults -- 29 reports of sexual assault in 2018, down from 33 the previous year.
The celebratory occasion comes at a contentious time for Trump, who gave a critical on-camera reaction to special counsel Robert Mueller's Wednesday statement as he was departing the White House to travel to Colorado.
Trump said Mueller "should never have been chosen" and was "a true never Trumper."
The criticism was in reaction to the first statement Mueller delivered on camera about his investigation into Russian interference into the 2016 election and questions of obstruction of justice. Mueller emphasized he did not have the "option" to charge the president with a crime due to Department of Justice policy, but said "if we had confidence that the president clearly did not commit a crime, we would have said so."
Trump insisted Mueller "said, essentially: 'You're innocent.' There was no crime, there was no charge because he had no information."
Trump did not mention Mueller or the investigation at the speech, but he did make one dig at the press. After saying each graduate has the inner strength to "vanquish any menace that dares to threaten our country or our people," Trump said "I wonder how that's going to be viewed -- that statement -- tomorrow in the press. You can imagine. And that's okay. Let them think whatever they want to think."
Trump did spend a few minutes touting his achievements, echoing his typical campaign speeches. He said America is respected again on the world stage, the economy is strong, and the military is improving.
The potential for Trump to make political comments at the solemn ceremony did not seem to bother families as they waited for the commencement to begin.
Sally Smith, the mother of Charles Andrew Smith, said her son learned resilience and perseverance at the Air force Academy, balancing classes, military training and playing football.
"That's what I'm most proud of," Smith said.
"I think it's just a huge honor to the cadets that he [Trump] would take the time. He supports the military and this is his way of showing it."
Phoebe Bacogiannis, mother of graduate Nicholas Bacogiannis, expressed excitement for a president she said is so "pro-military."
"As long as all of our boys are safe ... I'm sure that's what his message is going to be and that's what I'm going to take away."
Trump graduation speech at the Air Force Academy is his first during his presidency. President Barack Obama last spoke at the graduation in 2016.
That year, one of the Thunderbird jets that participated in the ceremonial flyover at the graduation crashed not far from the Colorado Springs airport, due to a throttle malfunction. The pilot, Maj. Alex Turner, was able to maneuver the jet into a field and eject, avoiding causing harm to any bystanders.