[Read more on the Supreme Court’s decision on President Trump and DACA.]

President Trump may find himself in a political box of his own making when the Supreme Court rules on the fate of the Deferred Action for Childhood Arrivals program.

If the court decides that the administration has the right to end the program, known as DACA, Mr. Trump will face a consequence he has tried to put off for years: news coverage of efforts by the government to deport thousands of young immigrants in the midst of what is certain to be a difficult re-election battle.

In oral arguments on Tuesday, Chief Justice John G. Roberts Jr. suggested that there could be extensive human cost to overturning the program, and that it would need to be mitigated. Still, a ruling that supports the administration’s position sets up a situation in which Mr. Trump — who at times has praised the program and at others condemned it — will face potentially treacherous crosswinds.

The president, who is often pulled by what he thinks his supporters who oppose both legal and illegal immigration might want, has vowed to keep a campaign promise to end DACA, one of President Barack Obama’s singular efforts. At the same time, Mr. Trump has tried to argue that it would not be his fault that the program ended, but the Supreme Court’s.