House Speaker Paul Ryan (R-WI) has made clear he doesn’t agree with a proposal put forward by Donald Trump — whom Ryan has endorsed — to ban Muslim immigration into the United States, but in an interview with the Huffington Post Thursday, Ryan floated taking a President Trump to court if he tried to implement such a ban or some of his other controversial proposals unilaterally.

“I would sue any president that exceeds his or her powers,” Ryan said in a back-and-forth about Trump’s claims that he could implement a Muslim ban or build a Mexican border wall without congressional approval.

Ryan said he wasn’t sure of the “legal question” of whether Trump could institute a Muslim ban on his own as president.

“That’s a legal question that there’s a good debate about,” he said, citing the 1952 Immigration and Nationality Act.

“On the broader question, are we going to exert our Article I powers and reclaim this Article I power no matter who the president is? Absolutely,” Ryan said. He also said he discussed the limits of the executive power with Trump.

In the interview, Ryan said his endorsement of real estate mogul did not give Trump “a blank check,” and that he was still trying to achieve “real unity” between the presumptive nominee and his caucus.

“I am going to keep being who I am, I am going to keep speaking out on things where I think it’s needed, where our principles need to be defended, and I am going to keep doing that, I hope it’s not necessary,” Ryan said. “But the last thing I want to see is a another Democrat in the White House”

Update: Ryan’s office disputes the headline of this story.

“We believe this headline is flagrantly wrong, which is made clear when actually reading the speaker’s quotes,” Ryan spokesperson AshLee Strong said via email.