Sally Yates, who was appointed by Mr Trump's predecessor, Barack Obama, said she was not "convinced that the executive order is lawful".
"The Department of Justice will not present arguments in defence of the executive order," she said.
Ms Yates is due to be replaced by Mr Trump's nominee, Jeff Sessions.
In a letter to employees published by US media, she noted that the order had been challenged in court in a number of jurisdictions.
"My responsibility is to ensure that the position of the Department of Justice is not only legally defensible, but is informed by our best view of what the law is," she wrote.
"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."
shut by security operatives