The US Department of Defense has praised a soldier who came to the US as a refugee, as Donald Trump prepares to ban all of them from the country.

The department's official account posted the story of Corporal Ali J Mohammed, who serves in the US Marine Corps. "From refugee to Marine," the account wrote, praising the actions of a soldier who "takes the fight to the doorstep of those who cast his family out".

The post is in line with the kind of updates that tend to be done from the account. Except it was sent on the same day that Donald Trump intended to sign an order entirely banning refugees from the US, as part of measures he claimed were required for national security.

Trump Inauguration protests around the World Show all 14 1 /14 Trump Inauguration protests around the World Trump Inauguration protests around the World Activists from Greenpeace display a message reading "Mr President, walls divide. Build Bridges!" along the Berlin wall in Berlin on January 20, 2017 to coincide with the inauguration of Donald Trump as the 45th president of the United State Getty Trump Inauguration protests around the World An activist holds up a sign at the "We Stand United" rally on the eve of US President-elect Donald Trump's inauguration outside Trump International Hotel and Tower in New York on January 19, 2017 in New York Getty Trump Inauguration protests around the World Protesters burn a U.S. flag and a mock flag with pictures of U.S. President-elect Donald Trump outside the U.S. embassy in metro Manila, Philippines Getty Trump Inauguration protests around the World Filipino protestors hold placcards during a protest rally in front of the US embassy in Manila, Philippines, 20 January 2017. On the eve of President-elect Donald Trump's inaguration as the 45th president of the United States, Filipinos and Fil-Americans held a protest in front of the US embassy in Manila to denounce the incoming US president. Getty Trump Inauguration protests around the World Hong Kong police officers and security guards look on as an anarchist protester belonging to the Disrupt J20 movement sits after using a heavy duty D-lock and motorcycle lock to chain himself to a railing at the entrance gate to the Consulate General of the United States of America in Hong Kong to protest the inauguration of United States President-elect Donald Trump, Hong Kong, China, 20 January 2017. Two activists were arrested and taken away by Hong Kong police during the demonstration. Getty Trump Inauguration protests around the World A banner is unfurled on London's Tower Bridge, organised by Bridges Not Walls - a partnership between grassroots activists and campaigners working on a range of issues, formed in the wake of Donald Trump's election, which aims to build bridges to a world free from hatred and oppression. Getty Trump Inauguration protests around the World Protesters chain themselves to an entry point prior at the inauguration of U.S. President-elect Donald Trump in Washington, DC, U.S. Getty Trump Inauguration protests around the World Bridges Not Walls banner dropped from Molenbeek bridge in Brussels, Belgium, 20 January 2017, in an Greenpeace action part of protests Wolrd protest in solidarity with people in the US, the day Donald Trump sworn in as the 45th President of the United States. Getty Trump Inauguration protests around the World A woman holds an anti-U.S. President-elect Donald Trump placard during a rally in Tokyo, Japan, Getty Trump Inauguration protests around the World A Palestinian protester holds a placard during a demonstration against the construction of Jewish settlements in the occupied West Bank and against US President-elect Donald Trump, on January 20, 2017, near the settlement of Maale Adumim, east of Jerusalem Getty Trump Inauguration protests around the World Banners on North Bridge in Edinburgh as part of the Bridges Not Walls protest against US President Donald Trump on the day of his inauguration Getty Trump Inauguration protests around the World Russian artist Vasily Slonov (L) and his assistant carry a life-sized cutout, which is an artwork created by Slonov and titled "Siberian Inauguration", before its presentation on the occasion of the inauguration of U.S. President-elect Donald Trump, in a street in Krasnoyarsk, Russia Getty Trump Inauguration protests around the World A woman holds a banner during a march to thank outgoing President Barack Obama and reject US President-elect Donald Trump before his inauguration at a park in Tokyo, Japan, 20 January 2017. EPA Trump Inauguration protests around the World Palestinian demonstrators protesting this week against a promise by Donald Trump to re-locate the US embassy to Jerusalem Reuters

Corporal Mohammed moved to the US from Iraq. That is one of the seven countries that Mr Trump will ban from entering the country at all, which also includes Syria, Iran, Libya, Somalia, Sudan and Yemen.

Anyone from those countries will not be allowed to visit the US until more aggressive vetting procedures are in place. That is expected to take several months and will bring an end to much of the work the US has done in taking in refugees.

In writing about Corporal Mohammed, the official Pentagon account linked out to a story that was posted on the official website of the Marines on 23 January. It tells the story of the soldier, who was born and raised in Baghdad until he was 16.

After receiving death threats for having supported the US in Iraq, Corporal Mohammed and his family were forced to move to the United States.

He decided in November 2014 to sign up to the US Marine Corps and as a result was deployed back to Iraq. He now works in part to translate communications between the Marines and the Department of Defense and members of the Iraqi military.

“To be able to read, write and speak Arabic is normal to him, and for him to be a U.S. Marine and understand how we operate is just phenomenal,” said Major Ryan Hunt, Corporal Mohammed's team leader, in the post on the Marine's website. “He’s just a pleasure to work with and is a huge asset to this team. He’s had such a positive attitude and is very mature; sometimes I forget he’s only 23 years old.”

In the same post, Corporal Mohammed described how "America is my home, but Iraq is my homeland".