President Trump lashed out Wednesday at House Speaker Paul D. Ryan, R-Wis., over Ryan’s comments on birthright citizenship, saying he “should be focusing on holding the Majority.”

The extraordinary rebuke from Trump came one day after Ryan pushed back on the president’s remarks on the issue, saying “you cannot end birthright citizenship with an executive order.”

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

Ryan, who is not running for reelection, was in Kentucky on Tuesday campaigning for Republican Rep. Andy Barr when he responded to Trump’s comments about birthright citizenship. Democrats could gain control of the House if they flip 23 Republican-held seats in next week’s election.

Earlier Wednesday, Trump vowed to push forward with his call to end birthright citizenship, despite a backlash from legal scholars and some prominent members of his own party against his pledge a day earlier to take executive action on the matter.

In morning tweets, Trump said he would end the 150-year-old practice “one way or the other,” seeming to leave the door open to either congressional action or a constitutional amendment, which many legal scholars say would be necessary to achieve his aims.

Trump also said the issue would ultimately be decided by the Supreme Court.

Trump is seeking to end the long-standing right to U.S. citizenship for children born to noncitizens in the United States, a policy that he said in his tweets “costs our Country billions of dollars and is very unfair to our citizens.”

On Tuesday, leading Democrats and immigrants rights activists blasted Trump’s pledge to issue an executive order, and Ryan dismissed the idea during a radio interview, saying it is not consistent with the 14th Amendment of the Constitution.

Senate Judiciary Committee Chairman Charles E. Grassley, R-Iowa, meanwhile, said the issue is one on which Congress, rather than the president, should take the lead.

In his Wednesday tweet, Trump asserted that birthright citizenship is not subject to the 14th Amendment because of the inclusion of the phrase “subject to the jurisdiction thereof.”

Legal experts have debated for years how to interpret the citizenship clause of the 14th Amendment, but the consensus is one-sided: Most agree that it in fact grants citizenship to those born on U.S. soil.

The first section of the amendment 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.”

Some legal scholars argue that the phrase “and subject to the jurisdiction thereof” seems to give the government some leeway to restrict the right, just as other constitutional principles can be limited. But the mainstream opinion from both right and left is that it is more likely that a constitutional amendment, rather than federal legislation or an executive order, would be needed to change the birthright conferred on people born here.

In his latest tweets, Trump also highlighted a view expressed by then-Sen. Harry M. Reid in 1993 that “no sane country” would award citizenship to children of undocumented immigrants born on its soil. Reid, a Nevada Democrat, reversed his position in 1999, at which time he apologized for his earlier stance.

“Many legal scholars agree … Harry M. Reid was right in 1993, before he and the Democrats went insane and started with the Open Borders (which brings massive Crime) ‘stuff,’ ” Trump wrote.

He followed up later Wednesday afternoon with a tweet in which he shared video of Reid’s remarks on the issue on the Senate floor in 1993.

Reid responded in a statement that he had previously been wrong on the issue.

“In 1993, around the time Donald Trump was gobbling up tax-free inheritance money from his wealthy father and driving several companies into bankruptcy, I made a mistake,” Reid said.

He said that his wife, Landra, had immediately spoken with him after he proposed the “awful” bill and “set me straight.”

“Immigrants are the lifeblood of our nation,” Reid said. “They are our power and our strength. This president wants to destroy not build, to stoke hatred instead of unify. He can tweet whatever he wants while he sits around watching TV, but he is profoundly wrong.”

In one of his tweets, Trump also said that the term “anchor babies,” which has been used to describe children of noncitizens born in the United States, is “nasty.” Trump has often used the term himself.