WASHINGTON — Acting Attorney General Sally Q. Yates, a holdover from the Obama administration, ordered the Justice Department on Monday not to defend President Trump’s executive order on immigration in court.

“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,” Ms. Yates wrote in a letter to Justice Department lawyers. “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.”

The decision is largely symbolic — Mr. Trump’s nominee to be attorney general, Senator Jeff Sessions, is likely to be confirmed soon — but it highlights the deep divide at the Justice Department and elsewhere in the government over Mr. Trump’s order.

Mr. Trump has the authority to fire Ms. Yates, but as the top Senate-confirmed official at the Justice Department, she is the only one authorized to sign foreign surveillance warrants, an essential function at the department.