Former president Barack Obama has issued a Memorial Day message - saying America can never ‘truly repay’ the debt to the fallen – in remarks many contrasted with those of Donald Trump.

In a tweet posted on Monday morning while Mr Trump was attending a Memorial Day ceremony at Arlington National Cemetery, Mr Obama wrote: “We can never truly repay the debt we owe our fallen heroes.”

He added: “But we can remember them, honour their sacrifice, and affirm in our own lives those enduring ideals of justice, equality, and opportunity for which generations of Americans have given that last full measure of devotion.”

Many compared the former president’s tweet with one from Mr Trump a few hours earlier, in which he inserted politics into the day, and sought to suggest those who died fighting would be “very happy and proud” with his performance as president.

“Happy Memorial Day! Those who died for our great country would be very happy and proud at how well our country is doing today,” wrote Mr Trump.

“Best economy in decades, lowest unemployment numbers for blacks and hispanics EVER (& women in 18 years), rebuilding our military and so much more. Nice!”

Barack Obama unveils official portrait at National Portrait Gallery in DC

The comments by Mr Trump on a day used to honour those who have died while serving in the country’s armed forces, triggered immediate criticism. Many commentators said it was inappropriate for the president to try and score political points on such an occasion.

Former Army Gen Martin Dempsey, who served as Chairman of the Joint Chiefs of Staff during the administrations of Mr Obama, said on Twitter: “This day, of all days of the year, should not be about any one of us.”

John Kirby, a State Department spokesman in the Obama administration, called Mr Trump”s tweet “one of the most inappropriate, ignorant and tone-deaf things our Commander-in-Chief could have said on a day like today”.

Nate Bell, a conservative Arkansas politician also known for controversial remarks, said Mr Trump’s comment represented “perhaps the most disgusting Trump tweet ever”.

“Memorial Day is a solemn day to reflect on the memories of those who paid the ultimate sacrifice for freedom, liberty & justice for all,” he said.

“It’s NOT a ‘Happy’ day nor is it a day to tout your draft dodging ‘bone spurs’ self.”

VoteVets.org, a veterans’ rights which says it has 500,000 supporters across the country, also condemned the remark.