A spokesman for Mr. Obama declined to comment.
But Mr. Trump’s remarks have drawn angry rebukes from allies of the former president because his claims about Mr. Obama are false — he called or met with relatives of multiple fallen service members. Former military commanders, for their part, said Mr. Trump was politicizing one of the saddest and most sacred duties of the presidency.
Mr. Obama invited Mr. Kelly and his wife, Karen, to a breakfast for Gold Star families — those who have lost children in combat — at the White House in May 2011. The couple were seated at a table with the first lady, Michelle Obama. At the time, Mr. Kelly was the senior military assistant to Defense Secretary Leon E. Panetta.
Mr. Kelly has not addressed the dispute. But colleagues who worked with him at the Pentagon during that period said they did not recall him expressing unhappiness with the way Mr. Obama handled the death of his son. In a statement issued shortly after Lieutenant Kelly’s death, Mr. Kelly and his wife noted that “the nation he served has honored us with promoting him posthumously to first lieutenant of Marines.”
Other military commanders noted that neither Mr. Obama nor President George W. Bush routinely called the families of fallen soldiers because that would have been logistically impossible. It could also raise questions about why one family merited a call but another did not.
“It’s been my observation in all the years I’ve been in the military that all presidents, as commander in chief, feel an enormous sense of loss and compassion and pain about those who are killed under their command,” said Jack Keane, a retired four-star Army general. “How they express that is entirely up to them, and I think we should respect that.”
Credit Doug Mills/The New York Times
Referring to Mr. Trump’s predecessors, Gen. Martin E. Dempsey, a former chairman of the Joint Chiefs of Staff, said on Twitter: “POTUS 43 & 44 and first ladies cared deeply, worked tirelessly for the serving, the fallen, and their families. Not politics. Sacred Trust.”
Other former Obama officials castigated Mr. Trump for what they said was a cynical mischaracterization of Mr. Obama’s record, which included regular visits to Dover Air Force Base to greet the coffins of returning forces, pilgrimages to Arlington National Cemetery and visits to wounded troops at Walter Reed National Military Medical Center.
“Stop the damn lying — you’re the President,” former Attorney General Eric H. Holder Jr. wrote on Twitter. “I went to Dover AFB with 44 and saw him comfort the families of both the fallen military & DEA.”
When Mr. Trump made the comparison to Mr. Obama and other former presidents at a news conference on Monday, he dialed back his initial assertion that Mr. Obama did not call the families of fallen service members when a reporter asked him about it again.
“President Obama, I think, probably did sometimes and maybe sometimes he didn’t,” Mr. Trump said, standing in the Rose Garden alongside Senator Mitch McConnell, Republican of Kentucky and the majority leader. “That’s what I was told. All I can do is ask my generals.”
On Tuesday, it became clear that Mr. Trump’s source was Mr. Kelly, a former commander of the military’s Southern Command, whom he recruited in July from the Department of Homeland Security to serve as chief of staff. Officials credit Mr. Kelly with imposing discipline on an unruly West Wing staff and on how information is given to the president.
As a wartime commander, Mr. Kelly led troops in intense combat in western Iraq. In 2003, he became the first Marine colonel since 1951 to be promoted to brigadier general while in active combat.
The death of Mr. Kelly’s son may have played a role in his selection to the cabinet. During the transition, people close to Mr. Trump said he wanted people on his national security team who understood personally the hazards of sending Americans into battle.
But Mr. Kelly has been reluctant to discuss his son. He asked the hosts of the eulogy he gave, in St. Louis in 2010, not to mention Lieutenant Kelly when they introduced him.
Asked about his son on Memorial Day in an interview on Fox & Friends, Mr. Kelly, his voice choking, replied, “Finest guy.”
“Wonderful guy. Wonderful husband. Wonderful son. Wonderful brother. Brave beyond all get out,” he added. “His men still correspond with us. They still mourn him as we do.”