President Trump said in an interview released Tuesday that he will sign an executive order ending the right to citizenship for babies born in the United States to noncitizens and undocumented immigrants, potentially knocking down a cornerstone of American law and society.

The consensus from legal experts: The president doesn't have the power to do what he is promising. A president cannot unilaterally eliminate a right enshrined in the 14th Amendment to the Constitution.

"The point is not, 'Can he do it? Is it legal?'" said Philippe Weisz, managing attorney of the Philadelphia-based immigrant aid society HIAS-PA. "There's one clear reason he's doing this. He's distracting attention from what happened Saturday in Pittsburgh. Second, of course, is the upcoming election, a week from today. You combine those two, and you see an administration desperate to change the discussion."

Still, there was dread in Philadelphia as the news dominated headlines a week before the crucial and contentious midterm election, bringing endorsement from some and causing consternation and fear for others.

High school teacher Maureen Boland tweeted that a brilliant trilingual student, the child of refugees, was waiting for her when she arrived on Tuesday — "in a panic about the headlines."

The child wanted answers, and she had none to give.

"People are being made to feel angry. Kids are being made to feel afraid," tweeted the teacher at Parkway Center City Middle College.

As a candidate, Trump led the call for an end to birthright citizenship, echoed by fellow Republicans Bobby Jindal, Rand Paul, Rick Santorum, and Ben Carson. As president, Trump has pursued all means of reducing or ending legal and undocumented immigration to the United States, including banning entry from some majority-Muslim nations.

The move he outlined to the Axios news website would be the most controversial, but in line with his targeting of "anchor babies," who can enable parents and close family members to eventually live legally in this country.

Migrants line up to receive food at a church that was heavily damaged in a 2017 earthquake, as a thousands-strong caravan of Central Americans hoping to reach the U.S. border stops for the night in Niltepec, Oaxaca state, Mexico on Monday.

Trump drew immediate support from Sen. Lindsey Graham, the South Carolina Republican who once advocated for a bipartisan overhaul of the immigration system.

"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 in a statement.

House Speaker Paul Ryan, also a Republican, broke sharply with Trump over the matter on Tuesday, saying, "You obviously cannot do that."

"You cannot end birthright citizenship with an executive order," he told radio station WVLK in Lexington, Ky. "We didn't like it when Obama tried changing immigration laws via executive action, and obviously as conservatives, we believe in the Constitution."

Most scholars, liberal and conservative, agree it would take a constitutional amendment to deny automatic citizenship to children born in America to parents who live here without permission.

James Ho, a conservative, Trump-appointed federal appeals court judge, wrote in 2006 that birthright citizenship "is protected no less for children of undocumented persons than for descendants of Mayflower passengers."

About 30 countries around the world automatically grant citizenship to those born within their borders — which many conservatives argue is a low number, showing the U.S. is out of step with the world.

Trump told Axios on HBO, a four-part documentary news series that debuts this Sunday, that he has run the idea of ending birthright citizenship past his legal counsel, and intends to end the practice by issuing an executive order.

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

When the president's assertion was challenged, he answered, "You can definitely do it with an Act of Congress. But now they're saying I can do it just with an executive order."

He incorrectly said that the U.S. is "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 … It's ridiculous. It's ridiculous. And it has to end."

As the nation struggles through the aftermath of the mass shooting at a Pittsburgh synagogue and the pipe-bomb mailings to well-known Democrats, Trump has focused on a migrant caravan that is slowly making its way toward the U.S. border with Mexico. This week the Pentagon announced it was sending 5,200 troops to join about 2,100 National Guardsmen already there.

Seeking to end birthright citizenship "is clearly unconstitutional and a blatant attempt to stir up his base before the midterms," said Tyler Moran, director of the Immigration Hub, a Washington-based immigration research agency. "The president is desperate, and instead of uniting the country, he is choosing to double down on the politics of division."

The right to citizenship for those born on American soil is enshrined in the 14th Amendment, which 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."

The 14th Amendment was ratified in 1868, three years after the end of the Civil War. Crucially, its grant of citizenship to all people born or naturalized in the U.S. included former slaves, guaranteeing all citizens equal protection under law.

President James Madison, known as the Father of the Constitution, wrote on the topic:

"It is an established maxim that birth is a criterion of allegiance. Birth however derives its force sometimes from place and sometimes from parentage, but in general place is the most certain criterion; it is what applies in the United States; it will therefore be unnecessary to investigate any other."

Weisz, of HIAS, said Trump's promised executive order would be "absolutely unconstitutional."

"There is no clearer expression that we are a country of immigrants than the 14th Amendment," he said. "We are a nation that believes in the right of soil, not of blood. We don't confer citizenship based on who your mother and father are."

This article contains information from the Associated Press.