Democrats and corporate leaders, as well as Republicans, have urged Mr. Trump to preserve the program, and public opinion polls have found overwhelming support for allowing the young immigrants to stay and work in the United States.

But Attorney General Jeff Sessions and his former aide, Stephen Miller, who is now the president’s top national policy adviser, have been pushing Mr. Trump to end the program. Both are immigration hard-liners who see ending DACA as a core campaign promise that the president must adhere to.

Eleven state attorneys general wrote to Mr. Sessions in June threatening to mount a legal challenge to the DACA program unless the administration phased out the program by Sept. 5, which is Tuesday. In a meeting at the White House, Mr. Sessions informed Mr. Trump that he would not defend what he considered an unconstitutional order in court, according to people familiar with the conversation, and officials at the White House and the Department of Homeland Security have made the case to the president that his administration would look foolish if it argued in favor of preserving it.

The president has sent wildly divergent signals about the DACA program, publicly agonizing over the fate of the initiative for months. He has vowed to prevent deportations of minors in college while promising to crack down on all forms of immigration. Most of those in Mr. Trump’s White House, including his own family, support lenience toward immigrants in the program.

The president’s daughter Ivanka Trump and his son-in-law, Jared Kushner, who are both advisers to the president, back extending the DACA protections.

The policy change would affect about 800,000 undocumented immigrants currently shielded under the DACA program, potentially rescinding their legal status and subjecting them to deportation.

Immigration advocacy groups have said that ending the program would be a coldhearted step that would yield no benefit to the nation while endangering large numbers of young people raised in the United States who are seeking to work and pay taxes.