The US Supreme Court appears ready to overturn an Obama-era programme that protects nearly 700,000 undocumented immigrants from deportation.
The White House tried to end the Deferred Action for Childhood Arrivals (Daca) policy in 2017 as part of an immigration crackdown.
During oral arguments, the court's conservative justices seemed sympathetic to the White House stance.
A ruling is expected in 2020, months before the presidential election.
President Barack Obama set up Daca in 2012 to protect immigrants who as young people entered the US illegally or overstayed a visa. These migrants are known as "Dreamers".
Questions asked by the court's five conservative-leaning justices on Tuesday did not indicate any doubt over whether President Donald Trump's Department of Homeland Security (DHS) had the authority to cancel the programme.
As the hearing began, hundreds of Daca supporters rallied outside the Capitol Hill court, forcing police to temporarily close the street in front of the Supreme Court.
What did the conservative judges say?
The court has nine justices and five of them are viewed as conservative leaning.
Neil Gorsuch and Brett Kavanaugh, who were both appointed by Mr Trump, asked questions on Tuesday that were interpreted by observers as well-disposed towards the president's position.
Justice Kavanaugh called the White House's decision to cancel the programme "a considered decision" that adequately weighed the policy's legality with its impact.
Justice Gorsuch noted that even if the court ruled in favour of the "Dreamers" it would only prolong uncertainty for them.
"What good would another five years of litigation… serve?" he asked.
What did the liberal judges say?
Sonia Sotomayor asked lawyers for the White House whether the decision to cancel Daca was simply a "choice to ruin people's lives".
The justice added that Mr Trump had previously told Daca recipients "that they were safe under him and that he'd find a way to keep them here. And he hasn't."
Ruth Bader Ginsburg seemed to suggest the White House had not adequately weighed the impact of its decision to end the programme, noting, "they said it was illegal and said nothing about the policy".
What has President Trump said?
Minutes before the hearing began, the Republican president tweeted: "Many of the people in DACA, no longer very young, are far from 'angels.' Some are very tough, hardened criminals."
The Daca programme bars anyone with a criminal record from enrolling.