WASHINGTON — President Donald Trump turned his wrath on the speaker of the House Wednesday, criticizing Paul Ryan for saying Trump’s promise to end “birthright citizenship” was unconstitutional.

“Paul Ryan should be focusing on holding the Majority rather than giving his opinions on Birthright Citizenship, something he knows nothing about! Our new Republican Majority will work on this, Closing the Immigration Loopholes and Securing our Border!” Trump tweeted Wednesday afternoon.

Ryan's office did not respond to a request for comment.

Trump said in an interview with Axios that he plans to sign an executive order ending the practice that allows for children of non-American citizens who are born on U.S. soil to become citizens.

Afterward, Ryan, who is retiring at the end of this year and was campaigning for a vulnerable House Republican in Kentucky, said such an act would be unconstitutional.

"You cannot end birthright citizenship with an executive order," the Wisconsin Republican said in a Lexington, Kentucky, radio interview Tuesday. "We didn’t like it when Obama tried changing immigration laws via executive action, and obviously as conservatives we believe in the Constitution."

According to the 14th Amendment, "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."

If the president were to issue the order it would likely face legal challenges immediately. And many legal experts say it likely wouldn't survive the challenge.

"Here we have a situation where the text of the Constitution is quite clear and the Supreme Court has interpreted it that way," Garrett Epps, a constitutional law professor at the University of Baltimore told USA TODAY Tuesday. "So, for the president to assert that he can somehow overturn the text of the amendment and Supreme Court precedent by executive order is what we would call an extravagant claim."

Trump and Ryan have clashed in the past, on issues ranging from tariffs to the administration's policy that led to migrant children being separated from their families at the border.

The president has made clear that his closing argument ahead of Election Day is focused on immigration. He speaks frequently about a migrant caravan headed north through Mexico toward the United States and deploying thousands of troops to the border in an effort to halt the caravan. The group is made up of mostly Central Americans fleeing their home countries for economic, political and crime-related reasons.

The president has kept an aggressive campaign schedule leading up to the election, but has not been sent to dozens of competitive house districts. Ryan, for his part, has traveled to many of those.

More:US troops deployed to border will aid, not replace, agents

More:Paul Ryan disagrees with Trump's call to end birthright citizenship, says it would be unconstitutional

More:Midterm elections: Fearing loss of the House, Republicans blame each other. 'Welcome to Washington'

Contributing: William Cummings and David Jackson