Acting US Attorney General Sally Yates has been "relieved" and replaced hours after speaking out against President Trump's executive order placing a temporary ban on refugees and people from seven Muslim-majority nations entering America.

In a tweet, White House Press Secretary Sean Spicer said that Yates had been "relieved" and that President Trump had "named Dana Boente, US Attorney for the Eastern District of VA as Acting Attorney General".

Earlier in the evening a letter from Yates ordering Justice Department lawyers not to defend the president's executive order on immigration was published. In the letter, Yates said that she was not convinced the order was "lawful", adding "I am responsible for ensuring that the positions we take in court remain consistent with this institution's solemn obligation to always seek justice and stand for what is right.

"At present, I am not convinced that the defense of the Executive Order is consistent with these responsibilities nor am I convinced that the Executive Order is lawful."

Yates was a holdover from the Obama administration. She took the place of Attorney General Loretta Lynch while the new administration's pick for the job, Jeff Sessions, goes through the senate confirmation process.

In a statement, the White House said that Yates had "betrayed the Department of Justice by refusing to enforce a legal order designed to protect the citizens of the United States.

"Ms. Yates is an Obama Administration appointee who is weak on borders and very weak on illegal immigration," it continued.

Acting Attorney General Sally Yates
Acting Attorney General Sally Yates speaks at the Department of Justice in June, 2016 Getty

Yates' replacement, Boente, is quoted in the statement as saying: "I am honored to serve President Trump in this role until Senator Sessions is confirmed. I will defend and enforce the laws of our country to ensure that our people and our nation are protected."

Speaking to a Washington Post reporter, Boente said he would enforce the executive order "appropriately and properly".