The response from former Obama officials was swift and forceful.

Former Attorney General Eric Holder tweeted this photo and insisted: “Stop the damn lying. I went to Dover Air Force base with 44 and saw him comfort families,” a reference to one of Mr. Obama’s late-night trips to pay his respects to troops killed in Afghanistan.

Mr. Obama and President George W. Bush often visited wounded warriors at Walter Reed and Bethesda hospitals, a practice Mr. Trump has continued. In February, the president and his daughter Ivanka went to Dover for the return of the remains of a Navy SEAL killed in Yemen, the first casualty of his administration.

So far this year, the Pentagon says 16 Americans have been killed in action. Another 17 sailors died in accidents. In the first year of the Obama presidency, 344 were killed in action.

During last year’s campaign, Mr. Trump publicly feuded with the Khans, the parents of a Muslim American soldier killed in Iraq, after they criticized him at the Democratic Convention.

Today, the Khans said: “President Trump’s selfish and divisive actions have undermined the dignity of the high office of the presidency.”

The current controversy comes as questions are being raised about how and why the four soldiers died in Niger.

Senator Jack Reed is the top Democrat on the Armed Services Committee.