Sally Yates, who had been appointed under Barack Obama, earlier ordered justice department lawyers not to enforce the president’s executive order.
Dana Boente, US attorney for the Eastern District of Virginia, replaced her as acting attorney general.
He has directed the department to enforce Mr Trump’s order.
In a statement, the White House said Ms Yates had “betrayed” the department.
Mr Trump’s order temporarily banned nationals from seven Muslim-majority countries from entering the US, and sparked street protests in the US and abroad.
In a letter, Ms Yates had said she was “not convinced” that the president’s order was lawful.
“As long as I am the acting attorney general, the department of justice will not present arguments in defence of the Executive Order,” she said.
Within hours, the White House announced: “President Trump relieved Ms Yates of her duties.”
She had “betrayed the department of justice by refusing to enforce a legal order designed to protect the citizens of the United States”, a statement from the press secretary said.
Donald Trump’s critics are calling it the “Monday Night Massacre”. That’s a reference to President Richard Nixon’s Saturday night sacking of his attorney general during the depths of the Watergate scandal of 1973, the last time top justice department officials were forced out by a president.
This time around is a bit different, however. Acting Attorney General Sally Yates essentially forced Mr Trump’s hand when she ordered justice department lawyers not to defend the president’s recent immigration order in court.
Mr Trump could not abide such defiance from an Obama Administration holdover due for replacement soon anyway. Once again, however, his White House team could not help but turn the rhetorical volume up to 11 in announcing the firing, accusing Ms Yates of having “betrayed” the justice department.
Ms Yates’s move follows on the heels of a similar over-the-top reaction to a letter, signed by more than 100 career state department officials, condemning the immigration action as un-American.