Washington (CNN) As President Donald Trump weighs scrapping protections for nearly 800,000 young undocumented immigrants, focus is intensifying on Capitol Hill on whether congressional leadership can reach a deal to continue the popular Obama-era program.

It's unclear how drastically Trump may reshape DACA, the Deferred Action for Childhood Arrivals program, which gave young people who had come to the United States illegally as kids a chance to work and study in the US without fear of deportation. Sources on the Hill increasingly believe Trump is leaning toward ending renewals and new applicants to the program, and a source familiar has said the White House is considering that option.

If Trump were to end the program, it would force a gut-check moment for leadership on both sides of the aisle.

House Speaker Paul Ryan and Senate Majority Leader Mitch McConnell would have to decide whether they're willing to risk angering the most conservative wing of the Republican base by allowing a vote on what some on the right consider an "amnesty" -- which would almost certainly need Democratic votes to pass. Meanwhile Democrats, led by House Minority Leader Nancy Pelosi and Senate Minority Leader Chuck Schumer, will be forced to decide whether they are willing to swallow a compromise that could include border wall money in in exchange for protections for "Dreamers," a population they have long advocated for.

With a hotly contested 2018 midterm election looming, and a number of moderate Republicans representing areas with high numbers of Dreamers up for re-election, lawmakers may feel compelled to act to save the program.

Trump is expected to announce a DACA decision by September 5, the deadline set by a group of Republican state attorneys general who have threatened to sue over the program.

But two sources familiar with DACA discussions at the White House say the administration is looking at whether the attorneys general who are pushing this issue would be willing to extend their deadline.

One source said White House chief of staff John Kelly is among those officials advocating for such a delay. But the sources did not say whether Trump will listen to Kelly on the issue as he has come under tremendous pressure from inside the White House and from outside groups to end the DACA program.

Proposals

Republicans supporters of DACA are already circling the wagons to try to reach a compromise, alongside a full-court press from the Democrats to save DACA wholesale.

When Congress reconvenes next week, Republican Sen. Thom Tillis, of North Carolina, is likely to introduce a measure similar to a House proposal by Florida Rep. Carlos Curbelo that offers protections to approved undocumented immigrants for five years if they work, pursue higher education or serve in the military, a source familiar with his thinking told CNN. After meeting those requirements, recipients could apply for conditional permanent residency.

The legislation has a number of Republican backers in the House, and Tillis lends conservative credibility to the same effort on the Senate side.

"This is the moment in time when Republicans are going to get full and fair credit for everything immigration related. So they are either going to get credit for revoking the program and casting 800,000 people into legal limbo or get credit for fixing the problem," said Ali Noorani, the executive director of the National Immigration Forum.

Bipartisan support

Of all the immigration issues, DACA may have the largest share of bipartisan support on the Hill. Several pieces of legislation that would protect Dreamers have already been introduced in Congress. One such bill -- the "Dream Act" from Sens. Dick Durbin, D-Illinois, and Lindsey Graham, R-South Carolina -- was introduced in July and would give roughly 1 million young people permanent legal status if they passed background checks and meet requirements to retain employment or go to college.

In a conference call with reporters on Tuesday for the US Conference of Mayors, Republican mayors from Anaheim, California, and Mesa, Arizona, both talked about the importance of DACA, and the danger for Republican politicians in areas like theirs if it were rescinded.

"Speculating what would happen at the ballot box, gosh, I can't imagine it being good," Anaheim Mayor Tom Tait said.

"I think morality trumps partisan politics," Mesa Mayor John Giles said. "I think even conservative Republicans see this is a clear choice between right and wrong and the right thing to do is to embrace these great young people."

The problem

Congress already has a packed schedule looming in September. Congress must pass a spending bill, agree on a budget, raise the country's borrowing limit, renew the Children's Health Insurance Program, potentially fix Obamacare and find a way forward on tax reform. Adding an immigration bill to the mix, which would be politically perilous for members who hail from conservative districts, is asking a lot for a body that has accomplished little so far this year.

Hill sources don't expect a DACA fix to emerge right away when Congress reconvenes, even if Trump scraps the program right before they return. What's more likely, they say, is for negotiations to continue behind the scenes until leaders are confident they have a deal that can pass.

"Sen. Durbin is always open to discussion about how to give permanent legal status to these young people, but President Trump's border wall is a nonstarter," said Ben Marter, a Durbin spokesman, echoing repeated declarations from Senate Democratic leadership that any such poison pill would be automatically opposed in the spending debate.

While there are some Republicans that support protection for Dreamers, it's still a major political obstacle that could make life tough for Ryan and McConnell, who would have to weigh calling the fix as a stand-alone or attaching it to a must-pass spending deal. Many House Republicans come from deep red districts where Trump's message to crack down on illegal immigration resonated. For them, voting for a package to protect dreamers would be unpopular back home.

Immigration is such a touchy subject in the House that in 2013 the Senate passed a bipartisan immigration reform bill, but the effort died in the House because of political opposition from conservatives. Ryan, who in the past had urged a comprehensive proposal and worked with Democrats, has been especially careful during his speakership to avoid any signal that he is veering from his party for fear of a conservative backlash.

In a CNN town hall in January, Ryan told a young woman who asked if he wanted to deport her that congressional leaders were talking with the Trump administration about a solution.

"What we have to do is find a way to ensure that you can get right with the law," the speaker told the young woman, specifically dealing with those already in the United States. "We have to figure out how to fix this, but to do that, people need to have confidence that our laws are being followed, people know who's coming and going and we need to have a secure border."

"What we have to do is figure out how to have a humane solution to this very legitimate, sincere problem, and respect the rule of law," Ryan said.