Several justices also pointed to the 1898 Supreme Court ruling, United States v Wong Kim Ark, the landmark decision that upheld birthright citizenship in the case of a child born to Chinese immigrants living in the US.

Cecillia Wang, an ACLU attorney representing the plaintiffs in court on Wednesday, used the decision to argue that Trump’s executive order should be overturned.

“If we agree with you how to read Wong Kim Ark, then you win,” Justice Brett Kavanaugh said. “That could be just a short opinion.”

Whether the court ultimately issues a broad or narrow opinion remains to be seen. The difference between a sweeping ruling on constitutional grounds versus a more tailored opinion on statutory grounds is a critical one, legal experts said.

The justices could choose to focus on a 1952 law passed by Congress that codified birthright citizenship and not wade into the larger constitutional debate, said Stephen Yale-Loehr, an immigration law expert.

“The court does not like to rule on constitutional issues if it doesn’t have to,” Yale-Loehr said. “The court could argue that the Trump executive order is invalid on statutory grounds.”

The justices are expected to issue their decision in June.

It would be the first major immigration case decided by the court on its merits since Trump started his second term.

The court has taken up other immigration cases, but has so far sent them back to lower courts for further review.

Trump’s push to end birthright citizenship is one part of his larger immigration crackdown.

But it’s nevertheless a longtime goal of many on the right, and something Trump has supported since his first term in office.

A victory in this case would help Trump make the case that he is delivering on his campaign pledge to limit illegal immigration.

A loss would be a setback to Trump’s immigration agenda.

But it would also represent a larger blow to his efforts to aggressively expand executive power since returning to office.

The ruling in February overturning Trump’s sweeping global tariffs showed that the justices are not willing to give Trump a blank cheque to bypass Congress and the courts.

Trump signalled his interest in the case by attending arguments on Wednesday.

Critics said his appearance was an improper effort to influence the court on a decision with major repercussions for his domestic policy.

“We are the only Country in the World STUPID enough to allow ‘Birthright’ Citizenship!” Trump said incorrectly on social media after leaving the court.

Speaking at a White House Easter luncheon later on Wednesday, Trump said birthright citizenship was passed after the Civil War “for the babies of slaves”.

He added: “It wasn’t for billionaire Chinese people who have 57 children that become American citizens. They didn’t have that in mind. But, you know, it’s hard to explain that to some people.”