President Trump this week promised to end automatic rights to U.S. citizenship for children of illegal immigrants, thereby launching a legal debate that most say he can't win.

But Trump isn't entirely alone, and some conservatives and legal scholars believe he has a case even as most dismiss his plan as a shallow attempt to motivate midterm election voters.

The 14th Amendment’s citizenship clause states that “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.” Most say that means even the children of illegal immigrants are deemed to be U.S. citizens if born in the country.

But some conservatives have argued that children born in the U.S. to illegal immigrants can be denied citizenship. John Eastman, a law professor at Chapman University Fowler School of Law, said the 14th Amendment does not mandate birthright citizenship and has been misapplied for years.

Eastman said the phrase “and subject to the jurisdiction thereof" originally was meant to refer to those with full allegiance to the United States. That opens the door to an interpretation that says the 14th Amendment doesn't automatically confer citizenship to children born in the U.S. to illegal immigrants.

[Related: George Conway disagrees with wife, believes Trump's proposal to end birthright citizenship is 'unconstitutional']

Eastman added that an executive order by Trump addressing birthright citizenship is “merely requiring that the bureaucracy actually enforce the laws as written."

“If we exaggerate the meaning of the 14th Amendment, we deprive Congress the power to make judgments about our immigration policy,” Eastman said.

The Supreme Court weighed in on birthright citizenship more than 100 years ago in the 1898 case U.S. v. Wong Kim Ark. The court held then that the son of Chinese immigrants who was born in San Francisco was a U.S. citizen under the 14th Amendment.

But that case only applied to children of permanent resident immigrants, not illegal immigrants. Eastman said that means the Supreme Court could be asked to rule on that question, which still hasn't been answered.

Senate Judiciary Committee Chairman Chuck Grassley, R-Iowa, agreed on Tuesday that the application of the 14th Amendment to illegal immigrants could still be an open question.

"Birthright citizenship for the children of permanent resident immigrants under the Fourteenth Amendment is settled law, as decided by the U.S. Supreme Court in United States v. Wong Kim Ark," he said. "There is a debate among legal scholars about whether that right extends to the children of illegal immigrants."

But there are many other hurdles the idea would have to clear. Grassley, for one, signaled he doesn't favor an executive order and says it's something Congress should deal with.

“I will closely review President Trump’s executive order,” Grassley said. “As a general matter, this is an issue that Congress should take the lead to carefully consider and debate.”

Many others argue it's unlikely the Supreme Court would reverse what has been U.S. practice for decades.

“I don’t see any votes on the Supreme Court for upholding an executive action of this kind,” said Ilya Shapiro, a senior fellow at the Cato Institute. Shapiro also said any change would need to be done through a constitutional amendment or legislation, not executive action alone.

“I think he’s making a political move a week ahead of the election,” Shapiro said of Trump. “He’s floating a trial balloon.”

“The president cannot erase the Constitution with an executive order, and the 14th Amendment’s citizenship guarantee is clear,” added Omar Jadwat, head of the ACLU’s Immigrants’ Rights Project. “This is a transparent and blatantly unconstitutional attempt to sow division and fan the flames of anti-immigrant hatred in the days ahead of the midterms.”

But Trump's surprise proposal won support from another key Republican senator, Lindsey Graham of South Carolina, a sign the idea will at least linger as a possibility among GOP lawmakers.

“The United States is one of two developed countries in the world who grant citizenship based on location of birth,” Sen. Lindsey Graham, R-S.C., said in a statement. “This policy is a magnet for illegal immigration, out of the mainstream of the developed world, and needs to come to an end.”

Graham said he intends to introduce legislation similar to Trump’s measure.

Trump announced his push for the change to citizenship policy in an interview with Axios published Tuesday, in which he said he can end birthright citizenship through an executive order.

“It was always told to me that you needed a constitutional amendment,” Trump said. “Guess what? You don’t.”

Trump’s targeting of birthright citizenship through an executive order follows a promise he made during the 2016 presidential campaign to end the practice.

"We're the only country in the world where a person comes in and has a baby, and the baby is essentially a citizen of the United States ... with all of those benefits," the president told Axios. "It's ridiculous. It's ridiculous. And it has to end.

Thirty countries in the Western Hemisphere provide birthright citizenship, including Canada and Mexico, according to the Harvard Human Rights Journal.