YORK, Pennsylvania (AP) _ The crisis of unaccompanied children at the U.S.-Mexico border has made immigration a pivotal issue with November elections approaching, potentially affecting campaigns in ways that hold risks for both the Republican and Democratic parties and for President Barack Obama.

How the issue plays out in coming months depends both on what happens in Texas, where border arrivals have declined in the summer heat, but could rise again, and in Washington, where Obama is weighing extending deportation protections and work permits to millions more people already living in the U.S. illegally.

Such a move would thrill Latino voters who will be crucial for the 2016 presidential election. But it could also rile up Republican base voters, who are more likely to turn out this November for midterm Congressional and state elections, and could make the difference in a handful of Republican-leaning states where vulnerable Democratic incumbents are trying to hold on.

The Republicans need to gain at least six Senate seats to take the majority from the Democrats. With the Republicans widely expected to keep control of the House, winning the Senate would give them the power to thwart Obama’s legislative agenda for the last two years of his term.

The border crisis has already scrambled the politics of immigration.

Establishment Republicans have feared that given the growing number of Latino voters, they would pay a political price over their inaction on comprehensive immigration legislation, which died this year in the House.

That may prove true in the presidential election in 2016, but so far this year Democrats have sometimes been on the defensive, as polls show the southern border crisis has caused support for comprehensive reform to dip while voters embrace calls for border security.

Senate Democrats seeking re-election in conservative states have cautioned Obama against proceeding unilaterally with the deportation protections. Republicans warn the president would pay a steep price politically for taking such a step.

“I think there will be a backlash, not necessarily that people will automatically come to vote for Republicans, but like in so many elections they might just stay home because they’re disgusted,” Rep. Scott Perry, a first-term congressman from southeast Pennsylvania.

Although Perry’s heavily rural district is far from the Texas border, immigration has emerged as a top concern for his constituents, eclipsing the federal deficit and Obama’s controversial health care law.

“Right now at this current time, I would say immigration is the No. 1 issue on people’s minds,” Perry said in an interview.

The influx of unaccompanied Central American children who crossed the border illegally this spring overwhelmed shelters and set off a debate over the roots of the causes and how the U.S. should respond.

Many Republicans and some Democrats blamed a 2008 anti-sex trafficking law that entitles minors from countries that don’t border the U.S. to receive deportation proceedings and an opportunity to make their case before a judge. In practice, that allows many of the minors to stay in the U.S. for years as their cases make their way through the system, a situation many lawmakers said encouraged Central American families to send their children north to flee dire poverty and gangland violence.

For now, Republicans are able to boast that the House took action to address the border crisis before leaving Washington for its August recess, even though the Senate and Obama did not.

Republicans “demanded that we stay and pass a bill so we could show the American people `This is what we stand for,”’ Perry recently told a group of small-business owners in Pennsylvania.

He was referring to the House Republicans’ legislation to spend $694 million on the border and make controversial policy changes to return the migrants home more quickly, as well as end an Obama program that granted work permits to more than a half-million immigrants brought to the U.S. illegally as kids.

But there’s also a risk for Republican lawmakers in making immigration a central campaign issue, particularly in opposing any Obama move to extend deportation protections.

Republicans are already hearing from angry constituents who want Obama impeached, and executive action by the president would likely only increase such demands. That’s an unwelcome prospect for most Republican officeholders who see impeachment as a political loser, since it would be certain to energize Democratic voters and likely turn off many mainstream Republicans.

“The problem that Republicans have right now is that they have engineered a strategy to turn out their base voters in a midterm election and that may backfire against them as their base voters demand that House Republicans keep going farther and farther to the right,” said Rep. Steve Israel, the chairman of the Democratic Congressional Campaign Committee.


Associated Press writer Erica Werner contributed to this report.