President Trump resurrected a much-debated but rarely tested legal question when he said he planned to issue an executive order that would end the automatic grant of citizenship to those born in this country to noncitizens.

Legal experts have debated for years how to interpret the citizenship clause of the Constitution’s 14th Amendment, but the consensus is one-sided: Most agree with the long-held tradition that it grants citizenship to those born on U.S. soil.

The first section of the amendment says: “All persons born or naturalized in the United States, and subject to the jurisdiction thereof, are citizens of the United States and of the State wherein they reside.”

Some legal scholars argue that the phrase “and subject to the jurisdiction thereof” seems to give the government some leeway to restrict the right, just as other constitutional principles can be limited.

But the mainstream opinion from both right and left is that it is more likely that a constitutional amendment, rather than federal legislation or an executive order, would be needed to change the birthright conferred on people born here.

“Regardless of whether birthright citizenship is a good idea, it’s enshrined in the 14th Amendment and so would take another constitutional amendment to change,” said Ilya Shapiro of the libertarian Cato Institute.

“There’s an active academic debate over whether mere legislation could change it with respect to illegal immigrants and tourists, but regardless it’s not something that can be done by executive action alone,” he said.

President Trump spoke to reporters about immigration on Oct. 13, before leaving D.C. for a rally in Kentucky. (The Washington Post)

House Speaker Paul D. Ryan (R-Wis.) and other conservatives generally favorable to Trump agreed with that assessment. Some wondered if such an executive order was actually being drafted, but it is a certainty that it would be immediately challenged.

“Aside from being unconstitutional, such an executive order would exacerbate racial tensions, exploit fears and drive further polarization across the country at a moment that calls for unity and inclusion,” said Kristen Clarke, president and executive director of the Lawyers’ Committee for Civil Rights Under Law. “It is hard to imagine an executive order that would be more ill-timed or misguided given recent events across the country.”

Trump has made immigration a favorite topic in advance of next week’s midterm elections, and he said in an interview released Tuesday that advisers have told him that he has the power to end birthright citizenship.

“It was always told to me that you needed a constitutional amendment. Guess what? You don’t,” Trump told Axios in an interview scheduled to air as part of a new HBO series starting this weekend.

When told that his view is disputed, Trump asserted: “You can definitely do it with an act of Congress. But now they’re saying I can do it just with an executive order.”

In the part of the interview that was released, it was not clear whether Trump would seek to deny citizenship to the baby of any noncitizen or just to the children of people who are in the country illegally.

The most-cited Supreme Court decision on the issue is the 1898 case United States v. Wong Kim Ark. The court held that a child born to Chinese immigrants who were legal residents was a birthright U.S. citizen under the 14th Amendment.

Related, but less directly on point, was the 1982 case Plyler v. Doe, which held that denying illegal immigrant children admission to public schools would violate the 14th Amendment’s equal-protection clause.

Justice William Brennan, writing for the majority in the 5-to-4 decision, noted language from the Wong Kim Ark decision.

He said that “no plausible distinction with respect to Fourteenth Amendment ‘jurisdiction’ can be drawn between resident aliens whose entry into the United States was lawful, and resident aliens whose entry was unlawful.”

But modern Supreme Courts simply have not been presented with the issue, so it is unclear how the current justices would see it.

Some legal experts question whether the 14th Amendment provides such a broad mandate and say the law granting citizenship has developed without real input from Congress.

The 14th Amendment granted citizenship to recently freed slaves, and was an answer to the Supreme Court’s now-discredited Dred Scott ruling, which said that no person of African descent, even if born in this country, could ever become a citizen.

But some legal analysts have said that does not mean all born in this country are automatically citizens.

Michael Anton, a former national security official in the Trump administration, made the case in an op-ed in The Washington Post: “The notion that simply being born within the geographical limits of the United States automatically confers U.S. citizenship is an absurdity — historically, constitutionally, philosophically and practically,” he wrote.

Sen. Lindsey O. Graham (R-S.C.) applauded Trump for raising the issue.

“This policy is a magnet for illegal immigration, out of the mainstream of the developed world, and needs to come to an end,” he said. “I plan to introduce legislation along the same lines as the proposed executive order from president.”

In 1995, under President Bill Clinton, the Justice Department’s Office of Legal Counsel took the position that birthright citizenship could not be denied absent a constitutional change. “Because the rule of citizenship acquired by birth within the United States is the law of the Constitution, it cannot be changed through legislation, but only by amending the Constitution,” then-Assistant Attorney General Walter Dellinger told Congress.

He said congressional attempts to deny citizenship would be unconstitutional. “We cannot and should not try to solve the difficult problems illegal immigration poses by denying citizenship to persons whose claim to be recognized as Americans rests on the same constitutional footing as that of any natural-born citizen,” he said.

Even some conservative legal analysts favored by Trump said that the 14th Amendment grant of citizenship was beyond dispute.

James C. Ho, a conservative recently nominated by Trump and confirmed to the U.S. Court of Appeals for the 5th Circuit, is among them.

“Birthright citizenship is guaranteed by the 14th Amendment,” he wrote in a 2006 essay. “That birthright is protected no less for children of undocumented persons than for descendants of Mayflower passengers.”