“This is an outrageous and disrespectful lie even by Trump standards,” Benjamin J. Rhodes, a former deputy national security adviser to Mr. Obama, posted on Twitter. “Also,” Mr. Rhodes added, “Obama never attacked a Gold Star family.”
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.
Several former Obama administration officials recalled the former president’s walks through Section 60 at Arlington National Cemetery, where the dead from Iraq and Afghanistan are buried, his visits to the wounded at Walter Reed National Military Medical Center, and the time he spent with families of the fallen at the White House and around the country.
In August 2011, after a Chinook military helicopter was shot down over Afghanistan, killing 38 people, including 25 Special Forces troops, Mr. Obama consoled the families of all those killed, according to Jeremy B. Bash, a former chief of staff to Defense Secretary Leon E. Panetta, who attended the ceremony.
David Axelrod, a senior adviser to Mr. Obama, said, “I don’t recall anything moving him more. He saw it as his duty to console them as best he could and thank them on behalf of the nation.”
But several officials said it was not always realistic to expect presidents to call the families of every fallen soldier. During the peak years of the wars in Iraq and Afghanistan, Mr. Obama and former President George W. Bush faced hundreds of fatalities each year.
In 2009, the first year of Mr. Obama’s presidency, there were 317 American military fatalities in Afghanistan and 149 in Iraq. So far this year, there have been 11 fatalities in Afghanistan and 14 in Iraq. Seventeen sailors were killed in accidents involving two Navy warships, the John S. McCain and the Fitzgerald.
While he did not explain why he had not called their families, Mr. Trump said he had written letters to the family members over the weekend, which he said would be mailed later in the day or on Tuesday. He said he also planned to call them.
“I felt very, very badly about that,” he said. “The toughest calls I have to make are the calls where this happens. Soldiers are killed. It’s a very difficult thing,” he said. “Now, it gets to a point where, you know, you make four or five of them in one day. It’s a very, very tough day. For me, that’s by far the toughest.”
A senior official said Mr. Trump had planned to speak sooner to the families, but the White House had to wait until the Pentagon’s paperwork was completed.
Pentagon officials said the military’s Africa Command was putting together a detailed timeline of the attack and of the response by French helicopters that first provided air cover for the badly outnumbered American and Nigerian forces, and eventually medical evacuation.
On Monday, Senator Jack Reed of Rhode Island, the ranking Democrat on the Armed Services Committee, joined a growing chorus calling for a review of the circumstances leading to the ambush.
After he answered the question about his response to the attack, Mr. Trump was pressed later in the news conference about his claim that Mr. Obama had never called bereaved families. This time, he seemed to soften his tone.
“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.”