President Donald Trump said in an interview published Tuesday that he intends to sign an executive order that would end birthright citizenship for the children of many immigrants to the U.S. — but House Speaker Paul Ryan quickly rejected the plan.

Trump, in an interview with Axios, part of which aired Tuesday morning, said birthright citizenship “has to end” and that it would, “with an executive order.”

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

"It's in the process. It'll happen with an executive order,” he said, adding that he's consulted with the White House counsel on the matter.

Under the 14th Amendment, citizenship is awarded to children born in the U.S., or in U.S. territories, to parents of immigrants to the country.

Hours later, House Speaker Paul Ryan, R-Wis., who rarely breaks with the president, rejected Trump's comments, explaining that the president "cannot end birthright citizenship with an executive order."

"You obviously cannot do that. You cannot end birthright citizenship with an executive order. We didn’t like it when Obama tried changing immigration laws via executive action, and obviously as conservatives, we believe in the Constitution," Ryan told WVLK radio. "I'm a believer in following the plain text of the Constitution, and I think in this case, the 14th Amendment's pretty clear, and that would involve a very very lengthy Constitutional process.

"I believe in interpreting the Constitution as its written, and that means you can't do something like this via executive order," Ryan added.

Trump had made his comments to "Axios on HBO.” Clips of the interview were released Tuesday morning, but the entire interview will air Sunday night.

"It was always told to me that you needed a constitutional amendment. Guess what? You don't," Trump said. "You can definitely do it with an Act of Congress. But now they're saying I can do it just with an executive order."

Later Tuesday, Vice President Mike Pence echoed Trump's remarks, saying at a Politico Playbook panel that "we are looking at action that would reconsider birthright citizenship."

Sen. Lindsey Graham, R-S.C., a close Trump ally, said he would introduce legislation in the Senate that would end birthright citizenship.

"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. "I plan to introduce legislation along the same lines as the proposed executive order from President Trump.”

Democrats slammed Trump after his interview.

"President Trump’s new claim he can unilaterally end the Constitution’s guarantee of citizenship shows Republicans' spiraling desperation to distract from their assault on Medicare, Medicaid and people with pre-existing conditions," said House Minority Leader Nancy Pelosi, D-Calif. "The President does not have the power to erase parts of the Constitution, but he and the GOP Congress have spent two years trying to erase protections for people with pre-existing conditions."

The U.S. is not the only nation in the world that grants birthright citizenship, as Trump stated. In fact, as of 2015, at least 32 other nations had passed laws granting some form of birthright citizenship, according to Politifact.

An NBC News/Wall Street Journal poll released in September 2017 found that 65 percent of Americans believe the U.S. should continue granting citizenship to all children born in the country. Only 30 percent said this should be changed so children of undocumented immigrants aren't automatically granted citizenship.

Trump's executive order, if and when it is signed, will almost certainly face legal challenges due to the fact that birthright citizenship is rooted in the interpretation of a constitutional amendment. The "Citizenship Clause" of the 14th Amendment 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."

Many legal scholars believe the issue was settled by an 1898 decision of the U.S. Supreme Court involving a man born in the United States to Chinese parents who lived here legally.

After a trip abroad, Wong Kim Ark was blocked from re-entering the country on the grounds that he was not a citizen. He fought back and won. By a 6-2 vote, the court said the 14th Amendment applied to virtually everyone born in the U.S., except for children of enemies of the U.S. or of foreign diplomats, or children born on Native American reservations, which were considered sovereign entities.

Nearly 100 years later, in 1982, the Supreme Court used language that seemed to indicate the protection applied to children of illegal immigrants as well.

In ruling in Plyler v. Doe, Texas must provide a free public education to undocumented children, the court said in a footnote that “no plausible distinction with respect to 14th Amendment ‘jurisdiction’ can be drawn between resident aliens whose entry into the United States was lawful, and resident aliens whose entry was unlawful.”

Some conservatives, however, argue that the court has never explicitly answered the question and that citizenship should be based on mutual consent, applying in cases when parents agree to submit themselves to US law in return for the privilege of having their children declared citizens.

Other executive orders about immigration signed by Trump — including the various iterations of his travel bans — were challenged in court, with the case over the president's final ban making its way up to the Supreme Court (the court ruled to uphold the latest ban).

During the 2016 presidential campaign, Trump had called for ending “birthright citizenship," but had so far not taken action as president.

But in recent weeks, with the midterm elections nearing, Trump has renewed his drive to end migrants coming across the border, tweeting often on the topic and vowing to take drastic actions.

In one such step, the Pentagon announced Monday it will deploy 5,200 additional troops to the U.S.-Mexico border by the end of the week to stop thousands of migrants and refugees in a caravan from entering the country.