That reference was to the public feud Mr. Trump began with the parents of a Muslim American soldier, Humayun Khan, who was killed in Iraq in 2004. The soldier’s parents, Khizr and Ghazala Khan, appeared at the Democratic National Convention in 2016, where Mr. Khan criticized Mr. Trump.
Alyssa Mastromonaco, a former senior aide to Mr. Obama, used even stronger language on Twitter, calling Mr. Trump’s statement a lie — along with an expletive — and describing him as a “deranged animal.”
A spokesman for Mr. Obama declined to comment.
What made Mr. Trump’s assertion all the more remarkable was that he made it to defend his silence after three American soldiers were killed while on patrol on the border between Niger and Mali this month. The body of a fourth American soldier was recovered later.
On Monday, Mr. Trump said he had written letters to the families of the soldiers over the weekend, which would be mailed later in the day or on Tuesday. He said he also planned to call the families.
“I felt very, very badly about that,” he said. “It’s the toughest calls I have to make are the calls where this happens, soldiers are killed, and it’s a very difficult thing.” He added: “It gets to the point where you make four or five a day, it’s a very tough day, and for me, that’s by far the toughest.”
So far this year, there have been 11 American combat fatalities in Afghanistan and 14 in Iraq. Seventeen sailors were killed in accidents involving two Navy warships, the John McCain and the Fitzgerald. In 2009, the first year of Mr. Obama’s presidency, there were 317 American fatalities in Afghanistan and 149 in Iraq.
When Mr. Trump was pressed a few minutes later about his claim about Mr. Obama, he waffled.
“I don’t know if he did,” the president said. “I was told he didn’t often, and a lot of presidents don’t. They write letters.”
“President Obama, I think, probably did sometimes and maybe sometimes he didn’t,” Mr. Trump continued. “That’s what I was told. All I can do is ask my generals.”