Open this photo in gallery:

Activists celebrate the Supreme Court's birthright citizenship ruling outside of the Supreme Court on Capitol Hill, on Tuesday.Jose Luis Magana/The Associated Press

The U.S. Supreme Court has struck down President Donald Trump’s effort to end birthright citizenship, delivering a rare check to his anti-immigration agenda and attempts to expand executive power.

In a 6-3 ruling delivered Tuesday, the last day before a summer break, the court rejected Mr. Trump’s executive order directing the government not to recognize the citizenship of children born in the U.S. to undocumented immigrants, tourists or people on short-term work and study visas. Five of the justices found that Mr. Trump had violated the U.S. Constitution’s 14th Amendment.

Mr. Trump signed the order on his first day back in the White House last year. It was blocked by the courts while the litigation progressed. Mr. Trump signalled his intense interest in the case by personally attending Supreme Court oral arguments in the case in April, the first time a sitting president has done so.

The case, launched by the American Civil Liberties Union, was dubbed Trump v. Barbara after a Honduran citizen who lives in New Hampshire and volunteered to be the lead plaintiff.

In the ruling, two conservative justices, John Roberts and Amy Coney Barrett, joined the court’s three liberals in finding Mr. Trump’s executive order unconstitutional. Three other conservatives − Samuel Alito, Neil Gorsuch and Clarence Thomas − dissented. Conservative Brett Kavanaugh found that Mr. Trump’s order was not unconstitutional but did violate immigration law.

Analysis: U.S. Supreme Court reins in Trump and speaks volumes about the role of immigrants in America’s story

The 14th Amendment of 1868 provides that “all persons born or naturalized in the United States, and subject to the jurisdiction thereof, are citizens of the United States.” This provision has historically been understood to apply to nearly everyone born in the country, with the exception of the children of diplomats, who are subject to the laws of their own countries.

But Mr. Trump argued that that provision of the amendment was intended solely to grant citizenship to formerly enslaved people after the Civil War and not extend beyond that.

Mr. Roberts, the Chief Justice, wrote in the court’s majority opinion that “nothing in the succinct language” of the amendment’s citizenship clause conveys such limits.

“Citizenship, then and now, was the right to have rights − to freely participate in our political community. The Framers of the Fourteenth Amendment extended that promise to ‘every free-born person in this land,’” he wrote. “We keep that promise today.”

After the court’s decision, Mr. Trump called on Congress to pass a law ending birthright citizenship. Such legislation, however, would almost certainly be ruled unconstitutional as well.

“Congress should start TODAY to work on ending expensive and unfair to our Country, Birthright Citizenship,” the President wrote on social media Tuesday, describing the ruling as “too bad for our country.”

The court’s finding was generally expected, given the straightforward wording of the Constitution and more than a century of legal precedent and federal law. A major 1898 Supreme Court case concerning Wong Kim Ark, a man born to Chinese parents in San Francisco, has long established that the amendment conferred citizenship to nearly everyone born in the U.S.

To some legal scholars, the surprise was that Tuesday’s ruling was not more decisive.

Laurence Tribe, a constitutional expert and retired Harvard law professor, referred to the 14th Amendment and other post-Civil War constitutional changes as the “second founding,” a key expansion and protection of civil rights. He warned that such a narrow vote on the court meant future cases could open the door to racial discrimination.

“To me the sad news of this entirely predictable outcome is how close it was. Only five of the nine justices voted for a clear holding that the 14th amendment meant what it said. What a shameful split,” he wrote in an e-mail.

Elora Mukherjee, an expert in immigrants’ rights at Columbia Law, said she had expected a 7-2 decision, with only justices Thomas and Alito dissenting. Nonetheless, she said, the ruling is significant in placing limits on the President.

“The decision is an important rebuke against President Trump, who sought to change this fundamental protection embedded in the Constitution through an executive order,” she said. “That type of attempted power grab should shock everyone in a constitutional democracy.”

The conservative-majority court has tended to be highly favourable to Mr. Trump on his efforts to restrict immigration and expand his own power.

Last week, for instance, the court gave the President the go-ahead to strip temporary protected status from Haitians and Syrians in the U.S. in order to have them deported. It also upheld a policy of stopping asylum seekers at the border − before they can make asylum claims.

Earlier Tuesday, the court handed Mr. Trump victories on two other files, allowing states to ban transgender athletes from participating in women’s sports and allowing political candidates to co-ordinate more closely with moneyed campaign groups. On Monday it granted the President the power to fire the heads of independent government agencies without cause.

The reshaping of U.S. jurisprudence along the lines of Mr. Trump’s and Republicans’ views in recent years has also included the 2024 ruling that granted the President immunity from prosecution for actions taken as part of his official duties and the 2022 case that overturned federal protections for abortion rights.

At times, however, conservative justices have been willing to defy Mr. Trump on central parts of his agenda. In February, justices Roberts, Coney Barrett and Gorsuch joined the three liberals – Sonia Sotomayor, Elena Kagan and Ketanji Brown Jackson – to bar Mr. Trump from using the International Emergency Economic Powers Act to impose sweeping tariffs on nearly all U.S. trading partners. (Mr. Trump found a way around that ruling by using other laws to reimpose the levies.)

And despite the failure of his birthright citizenship order, he has carried out a mass deportation campaign and managed to limit the number of people entering the country on everything from asylum claims to high-skills H-1B visas. This past year, the U.S. experienced net-negative migration for the first time in at least 50 years.

Follow related authors and topics

Authors and topics you follow will be added to your personal news feed in Following.

Interact with The Globe