Republicans and even some Democrats have accused President Obama of being insufficiently engaged in the border crisis. (Brendan Smialowski/AFP/Getty Images)

Until now, the politics of immigration have been seen as a no-lose proposition for President Obama and the Democrats. If they could get a comprehensive overhaul passed, they would win. And if Republicans blocked it, the GOP would further alienate crucial Hispanic and moderate voters.

But with the current crisis on the Southwest border, where authorities have apprehended tens of thousands of unaccompanied Central American children since October, that calculus may be shifting.

Republicans and even some Democrats have accused Obama of being insufficiently engaged in a calamity that many say he should have seen coming.

And the president’s own party is deeply divided over what must be done now — particularly on the sensitive question of deporting children who have traveled thousands of miles and turned themselves in to U.S. authorities to escape from the desperate

situations they faced in countries such as Guatemala, Honduras and El Salvador.

The emergency has also renewed questions about the administration’s competence, reminiscent of those raised during the 2010 Gulf of Mexico oil spill, last year’s botched rollout of the health-care law and more recent revelations of mismanagement that jeopardized care of patients at veterans hospitals.

Obama’s goal now is to make clear to adults in Central America that there is no payoff for sending their children on the dangerous journey northward, said Cecilia Muñoz, the White House domestic policy director. “He feels intensely a responsibility to prevent an even greater humanitarian crisis,” she said.

That, however, means speeding the deportation of most of those who have already arrived, which many in Obama’s own party are resisting.

“It is contrary to everything we stand for as a people to try to summarily send children back to death . . . in a place where drug gangs are the greatest threat to stability, rule of law and democratic institutions in this hemisphere,” Maryland Gov. Martin O’Malley (D) said in Nashville, where the National Governors Association was meeting.

Rep. Beto O’Rourke (D-Tex.) agreed in an interview: “I would like to see him place greater emphasis on the interests of these children who are refugees from extreme violence and instability in their home countries” instead of “an acceleration of the deportation process at the expense of these children.”

But O’Rourke added that he has been surprised by the anger he has heard toward the immigrants from many of his El Paso constituents, who “feel like we can’t take care of everyone, and these children and their families are gaming the system.”

Not so long ago, the young faces that galvanized the immigration debate were of those dubbed the “dreamers.” Hundreds of thousands of them had been brought to the country illegally by their parents when they were children and found themselves in danger of deportation through no fault of their own.

In June 2012, Obama issued an executive order that those who met certain requirements be allowed to remain in the country and to work. The president said it would make the system “more fair, more efficient and more just” in light of the Republican-led House’s refusal to pass the Dream Act, which would have put the immigrants on a path to citizenship.

View Graphic Sudden surge in unaccompanied children at border

Now, the plight of another group of children has become a grim reminder that even the best-intended policies can produce unforeseen consequences.

A 2008 anti-trafficking law that passed Congress nearly unanimously and was signed by President George W. Bush gave new protections to children who were not from neighboring Canada or Mexico, stipulating that their asylum requests be fully adjudicated if they were picked up for being in the country illegally.

Administration officials say smugglers have exploited that statute and the long judicial processes that resulted from it, persuading Central American parents to risk sending their children on a dangerous journey to the United States in hopes that they would be able to stay permanently.

Republicans argue that Obama himself sent a signal that the borders were open to younger immigrants when he issued his 2012 executive order.

There is also the question of whether the Obama administration ignored the signs as the emergency was developing.

As far back as May 2012, Texas Gov. Rick Perry (R) warned Obama in a letter that “there is a surge of unaccompanied illegal minors entering the United States. Apart from being part of an obvious humanitarian crisis, these unaccompanied illegal minors have left the federal government scrambling to triage the results of its failed border security and immigration policies.”

At last week’s governors meeting, Iowa Gov. Terry Branstad (R) said the administration was “asleep at the switch.”

Some border-state Democrats have joined the criticism.

“The numbers have spiked recently, but this is not a new development,” said Rep. Ron Barber (D-Ariz.). “It seems to me that the administration just wasn’t paying close attention and could have acted sooner.”

Barber noted that 30 percent of apprehensions of illegal immigrants are made in his Tucson-area district, as are up to 47 percent of cartel drug-running arrests. His constituents, who already live in fear for their safety, are now seeing law enforcement agents diverted to child care.

“They’re doing a great job, but it’s not their job, and it’s allowed the front line to be thinned even further,” Barber added.

Muñoz, the White House policy director, insisted in an interview that the numbers of unaccompanied minors did not become unmanageable until May, at which point Obama mobilized the Federal Emergency Management Agency to coordinate a response from federal agencies and state and local governments.

While there have been waves of unaccompanied minors in recent years, the most recent surge “was different dramatically, and the minute it was clear that the numbers were looking differently, the president acted,” Muñoz said.

Yet even some Democrats say Obama has not appeared to be as engaged as they would like.

When the president made a fundraising swing through Texas without going to the scene of the crisis, Rep. Henry Cuellar (D-Tex.) complained on MSNBC: “He can’t even go 242 miles to the Texas border? Border community leaders want to see him down there on the border. And I think the optics and the substance of it is that he should show up at the border.”

But Rep. Pete Gallego, a Texas Democrat whose district includes more than 40 percent of the U.S.-Mexico border, said he was less concerned about Obama skipping a Rio Grande Valley photo opportunity than he is about a lack of engagement in Washington.

Obama’s request for $3.7 billion in emergency funding has been met with skepticism on Capitol Hill. In an interview, Gallego urged Obama to summon congressional leaders to the White House to begin negotiations to get something passed.

“Rather than going to the border, I’d rather he invite some people over and start a conversation about how we are going forward,” Gallego said in an interview. “How do you defend inaction in the face of crisis? How is that defensible for anybody?”

Meanwhile, the tensions among the president’s allies have grown.

Obama called comprehensive immigration reform his top priority after winning reelection in 2012 with more than 70 percent of the vote among Latinos and Asian Americans. And the prospects for an overhaul of border-control laws appeared favorable, as leading Republicans acknowledged that their party needed to make inroads with those fast-growing voting blocs.

In June 2013, the Senate passed a comprehensive bill that would provide a path to citizenship for the nation’s 11 million to 12 million immigrants in the country illegally. But a year of pressure from the Obama administration, Democrats and immigration advocates failed to convince House Republicans to take up the bill.

As the effort stalled in the House, advocates turned their attention — and anger — toward Obama, demanding that he use executive authority to stem deportations, which take place at the pace of more than 1,000 a day. One prominent immigration leader referred to Obama as the “deporter-in-chief,” prompting the president to summon activists to the White House for a dressing-down in March.

Two weeks ago, with Republicans criticizing the administration’s handling of the border crisis, Obama gathered advocates for another private meeting at the White House.

The session grew heated when some of them criticized the administration’s tough posture toward the children on the border, according to several people who attended.

Marshall Fitz, immigration policy director at the Center for American Progress, said that Obama, a former community organizer, told the group that “in another life, I’d be on the other side of the table.”

“The longer this debate goes on, the more both parties have to lose by not addressing it,” said Ali Noorani, executive director of the National Immigration Forum. “It’s not like a pendulum. It’s like a wrecking ball . . . just boom, boom, boom, boom.”

“The most important thing is, the president has to bring this crisis to a humane and resolute end — quickly,” said Simon Rosenberg, founder of the New Democrat Network, a think tank that has focused on the growing importance of Hispanic voters. “If you want immigration reform to pass soon — whatever ‘soon’ is — it is crucial that the government’s response to this crisis goes well, and the president has to do everything he can.”

Rep. Raúl M. Grijalva of Arizona, another Democrat who has called on Obama to visit the Texas border to view the situation firsthand, said the way the president handles the border crisis will leave an imprint on his legacy among the Hispanic voters who were so important to his reelection and remain a key to the future of the Democratic Party.

Latinos blame Republicans for the failure of comprehensive reform, he said, but now they want to “see who’s standing with us.”

Dan Balz contributed to this report from Nashville.