WASHINGTON -- U.S. President Donald Trump ignited eleventh-hour confusion Friday over Republican efforts to push immigration legislation through the House, saying he wouldn't sign a "moderate" package. The White House later walked back the comments, formally endorsing the measure and saying Trump had been confused.

The campaign-season tumult erupted as GOP leaders put finishing touches on a pair of Republican 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 and jeopardized Republicans' plans for votes on both bills next week. Leaders released a schedule for next week that included "possible consideration" of immigration legislation.

Earlier this week, House Speaker Paul Ryan had told colleagues that Trump supported the middle-ground package. 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 GOP 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., o 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 and curbing the existing legal immigration system. Those items are included in the middle-ground package.

"Go for it! WIN!" Trump wrote in a tweet that stopped short of explicitly endorsing the compromise plan.

Despite their policy clashes, both Republican factions have been eager for the votes to be held as a way to show constituents where they stand. In addition, party leaders want to move on from an issue that divides the GOP, complicating their effort to retain House control in November's elections.

The more conservative measure is seen as virtually certain to lose. Party leaders have nurtured hopes that the compromise version could pass, but Trump's backing would be crucial. His opposition would be an embarrassing and likely fatal setback.

Conservatives are leery of legislation protecting from deportation immigrants who arrived illegally, calling it amnesty.

After Trump made his comments on Fox, Rep. Patrick McHenry, R-N.C., the GOP's No. 2 vote counter, told reporters that leaders were seeking "clarity" from the White House. He suggested that plans for votes next week were being reconsidered.

"House Republicans are not going to take on immigration without the support and endorsement of President Trump," McHenry said.

Democrats are expected to solidly oppose both GOP bills, giving Republicans little leeway for losing support.

"When the president says he's not going to sign it, just shows how low his standards are," said House Minority Leader Nancy Pelosi, D-Calif.

The compromise bill would mandate that children with families seized entering the U.S. be kept together for as long as they are in the custody of the Homeland Security Department, which staffs border facilities and enforces immigration laws. Critics say family separation would still be possible because another agency could take parents being prosecuted into custody.

Spotlighting the political sensitivity of the issue, congressional Republicans have distanced themselves from the Trump administration's policy of separating children from their parents at the southern border. The White House has cited the Bible in defending its "zero tolerance" approach to illegal border crossings.

Both the conservative and compromise bills would provide money for Trump's long-sought border wall with Mexico. Each contains other strict border security provisions, and would end a visa lottery and tighten rules that let U.S. citizens sponsor relatives for legal status.

Both bills, which are still undergoing changes, contain provisions aimed at helping young immigrants brought to the U.S. illegally as children, often called Dreamers.

Hundreds of thousands of them have been protected by the Obama-era Deferred Action for Childhood Arrivals program, or DACA. Trump has terminated that program, though federal courts have temporarily kept it functioning. DACA has let the immigrants live and work in the U.S. in renewable two-year increments, but does not give them permanent legal status.

The latest version of the conservative bill would extend DACA protections for renewable six-year periods. They could later apply for permanent residency and eventually citizenship.

An expanded number of children who arrived legally with parents who have obtained work visas would also be covered.

------

Associated Press reporters Lisa Mascaro, Matthew Daly and Padmananda Rama contributed to this report.