WASHINGTON — President Trump ignited eleventh-hour confusion Friday over Republican efforts to push immigration legislation through the House, when he said he wouldn’t sign a “moderate” package. But the White House later walked back the comments, formally endorsing the measure and saying Trump had been confused.

The campaign-season tumult erupted as Republican leaders put finishing touches on a pair of bills: a hard-right proposal and a middle-ground plan negotiated by the party’s conservative and moderate wings, with White House input. Only the compromise bill would open a door to citizenship for young immigrants brought to the U.S. illegally as children, and reduce the separation of children from their parents when families are detained crossing the border – a practice that has drawn bipartisan condemnation in recent days.

“I’m looking at both of them,” Trump said when asked about the proposals during an impromptu interview on Fox News’ “Fox & Friends,” adding: “I certainly wouldn’t sign the more moderate one.”

The comment prompted widespread confusion on the Hill. Earlier this week, House Speaker Paul Ryan told his colleagues that Trump supported the middle-ground package, and White House aide Stephen Miller, an immigration hard-liner who has been accused of trying to sabotage immigration deals in the past, told conservative lawmakers at a closed-door meeting that the president backed that plan. But a senior White House official later said Trump had misspoken and believed his Fox interviewer was asking about an effort by Republcian moderates – abandoned for now – that would have forced votes on a handful of bills and likely led to House passage of liberal-leaning versions party leaders oppose. The official, who was not authorized to discuss internal conversations by name, spoke on the condition of anonymity.

The interviewer had specifically asked whether Trump supported a conservative bill penned by Rep. Bob Goodlatte, R-Va., or “something more moderate,” and asked whether he’d sign “either one.”

The White House later put out a statement formally endorsing the measure.

“The president fully supports both the Goodlatte bill and the House leadership bill,” said White House spokesman Raj Shah, adding that Trump would sign “either the Goodlatte or the leadership bills.”

Trump also weighed in by tweet, writing that any bill “MUST HAVE” provisions financing his proposed wall with Mexico.