President Trump criticized House Speaker Paul Ryan on Wednesday after Ryan broke with the president on his plan to end birthright citizenship for children born in the U.S. to illegal immigrants, and said Ryan should be more worried about holding the House in next week's midterm elections.

“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.

The president told Axios in an interview published Tuesday that an executive order was in the works that would end the 14th Amendment’s guarantee of automatic citizenship to children born on U.S. soil to noncitizen parents.

Trump said he was initially told birthright citizenship could only be terminated through a constitutional amendment, but told Axios his counsel informed him the change could be done with an executive order. But Ryan refuted the president’s claim Tuesday during a radio interview with WVLK in Kentucky.

“You cannot end birthright citizenship with an executive order,” Ryan said. “As a conservative, I’m a believer in following the plain text of the Constitution, and I think in this case the 14th Amendment is pretty clear, and that would involve a very, very lengthy constitutional process. But where we obviously totally agree with the president is getting at the root issue here, which is unchecked illegal immigration.”

The president’s scolding of Ryan comes days before the midterm elections and as Republicans work to keep control of the House.

But according to the site FiveThirtyEight, the GOP has just a 1-in-7 chance of maintaining their majority.