"As commander-in-chief, I'm pretty tired of some folks trash-talking America's military and troops," Obama told a Disabled American Veterans convention in Atlanta, Georgia.
Trump, who is vying with Democrat Hillary Clinton to succeed Obama, has called the US military a "disaster" and caused outcry by repeatedly disparaging the family of a slain Muslim American soldier.
Donald Trump mocked in latest 'The Simpsons' episode
Khizr Khan - whose son Humayun was killed in Iraq in 2004 - accused Trump of smearing Muslims and having "sacrificed nothing" himself.
That met a barrage of criticism from the Manhattan real estate mogul, who claimed he was "viciously attacked."
Trump's response has prompted outcry from fellow Republicans, who have praised so-called "Gold Star families" - those who have lost loved ones in war.
Democrats have been quick to seize on the comments as evidence Trump is ill suited to be commander in chief.
"No one has given more for our freedom and our security than our Gold Star families," said Obama.
"Our Gold Star families have made a sacrifice that most of us cannot even begin to imagine."
"We have to do everything we can for those families and honor them. And be humbled by them."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ