Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Donald Trump falsely claimed on Monday that former President Barack Obama didn't call the families of fallen service members.

"If you look at President Obama and other presidents, most of them didn't make calls — a lot of them didn't make calls — I like to make calls when it's appropriate," Trump said at a news conference in the Rose Garden when asked about why he had not addressed the recent deaths of American troops in Niger.

However, a former senior Obama administration disputed Trump's claim.

"President Trump's claim is wrong," the ex-official said. "President Obama engaged families of the fallen and wounded warriors throughout his presidency through calls, letters, visits to Section 60 at Arlington, visits to Walter Reed, visits to Dover, and regular meetings with Gold Star Families at the White House and across the country."

Pressed by reporters later in the news conference, Trump then admitted he didn't know what Obama's practice was in regard to the families of fallen service members.

"Sometimes it's a very difficult thing to do, but I do a combination of both," Trump said, referring to calling and sending letters to the families. "President Obama, I think probably did sometimes, and maybe sometimes he didn't. I don't know. That's what I was told."

Four U.S. Army Special Forces soldiers were killed in Niger on Oct. 4 in an ambush by suspected Islamic militants, the Army said. The United States was conducting military operations as part of a wide-ranging war on a variety of extremist groups in Africa.

White House Press Secretary Sarah Huckabee Sanders previously told reporters that Chief of Staff John Kelly briefed Trump about the attack the night it took place, but the president had not talked publicly about the deaths.

Trump said his letters to the families of those soldiers have yet to be sent but would be Monday or Tuesday and he added that he will call families "at some point."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Trump's comments touched off a firestorm on social media, including from Alyssa Mastromonaco‏, a former Obama staffer, who responded with an expletive.

that's a fucking lie. to say president obama (or past presidents) didn't call the family members of soldiers KIA - he's a deranged animal. — Alyssa Mastromonaco (@AlyssaMastro44) October 16, 2017

The White House didn't back down from Trump's claim in a statement later Monday.

"The president wasn't criticizing predecessors, but stating a fact. When American heroes make the ultimate sacrifice, Presidents pay their respects," Sanders said.

"Sometimes they call, sometimes they send a letter, other times they have the opportunity to meet family members in person. This president, like his predecessors, has done each of these. Individuals claiming former Presidents, such as their bosses, called each family of the fallen, are mistaken."

Obama called and wrote letters to families of fallen service members on multiple occasions, and visited them as well, according to numerous news reports at the time.

In 2009, Obama called the family of Sgt. 1st Class Jared C. Monti, who was killed in June 2006 in Afghanistan helping fellow soldiers. That same year, he consoled the grieving mother of a Marine killed by a roadside bomb in Afghanistan.

Obama's former White House photographer Pete Souza posted an image of Monti's parents, Paul and Janet, meeting the Obamas on his Instagram on Monday following Trump's remarks.

During the end of his first year as president, Obama also walked through and hugged visitors at Section 60 of Arlington National Cemetery, where fallen service members from the wars in Iraq and Afghanistan are buried.

The former president has publicly described the heart-wrenching task of writing letters to the families.

"As commander in chief, I have no greater responsibility than leading our men and women in uniform; I have no more solemn obligation sending them into harm's way. I think about this every time I approve an operation as president," he said in a May 2016 ceremony at Arlington.

"Every time, as a husband and father, that I sign a condolence letter. Every time Michelle and I sit at the bedside of a wounded warrior or grieve and hug members of a Gold Star family."

On Tuesday, Josh Earnest, who served as Obama's last White House press secretary, recalled those visits to Section 60, explaining to MSNBC that Obama often did so in private without informing the media.

"President Obama’s preference was always to not seek that attention," Earnest said. "Presidents in both parties understood that when we are talking about the sacrifice that America’s men and women are paying for our country, that it’s not about them personally. It’s not about the president."

President Barack Obama and Michelle Obama walk through Arlington National Cemetery after greeting family members of fallen service members on Veteran's Day 2012 in Arlington, Virginia. Lexey Swall / Getty Images

Former President George W. Bush also took the job of reaching out to families of dead service members as a serious and solemn "duty."

Bush often met privately with the families of service members who died fighting in Afghanistan and Iraq and wrote extensive letters, according to The Washington Times.

"People say, 'Why would you do that?'" the president told the paper in 2008, at the end of his presidency.

"And the answer is: This is my duty. The president is commander in chief, but the president is often comforter in chief, as well. It is my duty to be — to try to comfort as best as I humanly can a loved one who is in anguish."

CORRECTION (Oct. 16, 2017, 12:10 p.m.): Earlier versions of this article misstated the number of U.S. personnel killed in Niger on Oct. 4. Four Army Special Forces soldiers were killed, not two or three.