Acting Attorney General Sally Yates said in a letter to her department she is not convinced the order is consistent with U.S. law.
"Consequently, for as long as I am the acting Attorney General, the Department of Justice will not present arguments in defense of the Executive Order, unless and until I become convinced that it is appropriate to do so," she wrote.
Shortly after the letter was made public, Trump dismissed Yates who the White House said 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," spokesman Sean Spicer said in a statement, calling Trump's order "reasonable and necessary to protect our country".
Trump replaced Yates with Dana Boente, U.S. Attorney for the Eastern District of Virginia.
So far, the president's nominee to head the Justice Department, Jeff Sessions, has yet to be confirmed by the Senate, and it is unclear when Republicans will be able to muster the votes to get him through the chamber.
As Yates' letter was announced, House and Senate Democrats rallied on the steps of the Supreme Court against the order with hundreds of supporters looking on.
"This order is against what we believe in in America," Sen. Chuck Schumer, the Democratic minority leader, said. "The order will make us unsafe. The order will make us inhumane. And the order will make us less of America."
The protest comes amid continued opposition to the order from Trump's own party. So far, 11 Republicans have voiced objections in the 100-member chamber, including senior Sens. John McCain and Lindsey Graham, raising the stakes for Trump in the narrowly Republican-controlled Senate.
Despite the widespread opposition, the Trump administration has remained resolute in its defense of Trump's decision.
Following the revelation that a draft memo from State Department officials opposing the order was circulating through the agency, White House spokesman Sean Spicer said the authors "should either get with the program or they can go" - a now obvious foreshadowing of what was in store for Yates.