WASHINGTON (AP) — President Barack Obama's carefully cultivated Hispanic coalition was starting to splinter.
Immigration legislation on Capitol Hill was going nowhere. Deportations were nearing 2 million under Obama's watch. And the president was resisting calls to use executive actions to address the issue.
In early March, Obama's usually reliable supporters vented their frustration with a one-two punch to the White House: a scathing speech by a prominent immigration advocate who derided the president as "deporter in chief," then a threat from Hispanic lawmakers to vote on a resolution criticizing Obama for the soaring deportations.
The moves sent the White House scrambling. Hours before the vote, Obama summoned three of the lawmakers to the Oval Office to tell them he was ordering Homeland Security Secretary Jeh Johnson to study how the administration could enforce immigration laws "more humanely."
That order set off nearly nine months of intense internal deliberations over the scope of Obama's presidential powers and political wrangling between the White House and Democrats over how potentially provocative executive actions would impact the midterm elections.
Obama would ultimately wait until after the election to announce his decisions, unveiling sweeping measures Thursday to spare nearly 5 million people in the U.S. illegally from deportation.
This account of how the president reached that decision is based on roughly two dozen interviews with lawmakers, administration officials, congressional aides and immigration advocates. Some spoke on the condition of anonymity because they were not authorized to speak publicly about private conversations with the president and his top advisers.
LAST GASP FOR LEGISLATION
Even as Obama raised the prospect of executive actions, he was holding out hope that Congress would still pass broader legislation. The Senate had passed a wide-ranging bill in June 2013 with bipartisan support, but the measure languished in the Republican-controlled House.
For months, Obama and House Speaker John Boehner talked privately about whether the House might take up immigration. Boehner suggested there was a narrow window of opportunity in early summer, after most Republican lawmakers were past their primaries.
Obama was willing to accept that timeline, but administration officials said he was skeptical that it was just the latest in what he saw as Boehner's stalling tactics.
A small handful of House Republican supporters of immigration reform, including Reps. Mario Diaz-Balart of Florida and Paul Ryan of Wisconsin, were indeed working on legislative options. But they struggled not only to get buy-in from reluctant Republicans, but also attention from a dubious White House.
Any last hopes for a legislative breakthrough were derailed the night of June 10, when Rep. Eric Cantor, the Republican majority leader from Virginia, suffered a stunning primary defeat. Little-known challenger David Brat, an opponent of immigration reform, used Cantor's tepid support for immigration legislation against him, making other Republicans fearful of taking on the issue before the elections.
"That was the moment we realized immigration reform was dead, and we had to focus on Obama," said Kica Matos, a prominent immigration advocate.
Around the same time, law enforcement agents were reporting a surge of undocumented minors from Central America arriving at the U.S.-Mexico border. White House critics quickly pinned the blame on Obama's 2012 decision to defer deportations for some young people, saying it had encouraged more people to try to enter the U.S. illegally.
A House Republican leadership aide said the already slim chance for action in the House quickly "narrowed to the point of vanishing."
Two weeks after Cantor's defeat, Boehner arrived at the White House for an event celebrating golf, one of the few interests he shared with the president. Boehner told Obama there would be no vote before the end of the year.
Days later, Obama gathered immigration advocates in the Roosevelt Room to relay what Boehner had told him. "You could tell he was pissed, miffed," said Frank Sharry of the advocacy group America's Voice. As the meeting closed, advocates were escorted to the Rose Garden, where reporters had been scrambled for a hastily arranged announcement: Obama planned to circumvent Congress and act on his own.
"If Congress will not do their job, at least we can do ours," he declared.
SUMMER OF DISCONTENT
The president promised to decide on executive actions by the end of the summer. But as the White House began scouring its options, a rift was forming among Democrats on Capitol Hill.
Facing potentially disastrous midterm losses, some Senate Democrats questioned whether Obama ought to hold off until after Election Day. After all, Democrats were fighting their toughest races in conservative states where voters were skeptical about relaxing immigration laws.
The issue chased Democratic candidates wherever they went. GOP Senate candidates aired ads accusing Democrats of being complicit in an Obama plot to flout the Constitution. Democratic Sens. Mark Pryor in Arkansas and Kay Hagan in North Carolina faced persistent questions about whether they supported the president's plans.
Democratic lawmakers began making quiet, personal appeals to White House chief of staff Denis McDonough and other advisers to delay.
By the time Congress left town in late July, the party's top senators were largely split. Sens. Bob Menendez of New Jersey and Dick Durbin of Illinois had long been pressing Obama to bypass Congress on immigration and urged him to stick to his end-of-summer deadline. But other Democrats like Chuck Schumer of New York were telling their colleagues they favored a delay.
David Simas, the head of Obama's White House political operation, called the Democratic Senatorial Campaign Committee around Labor Day to ask for polling data about how immigration was playing in key states like Iowa. Sen. Michael Bennet of Colorado, the DSCC chair, told the White House that Obama's impending actions were deeply unpopular and that candidates feared they'd suffer the consequences.
At 8:59 a.m. on a Saturday in early September, an email from one of Obama's legislative liaisons landed in the inboxes of top Democratic Senate staffers: "Are you available to connect quickly, in the next 30 minutes?" Obama had decided to delay.
As the political wrangling played out publicly, Homeland Security Secretary Johnson was running an intensely secretive process to determine what actions Obama could impose. Johnson, who was in his first months running the sprawling agency, ordered that meetings be limited to senior officials and documents be couriered to participants rather than emailed.
Details remained so tightly held that even employees at two key agencies — U.S. Citizenship and Immigration Services and Immigration and Customs Enforcement employees — only learned the details of what they would have to enforce hours before Obama's speech Thursday night.
Administration officials said the outlines of Obama's plan were largely settled on this summer. But Obama kept pushing for more options on two fronts: deportation deferrals to agricultural workers and to the parents of the so-called Dreamers, young people spared from deportation under the president's 2012 direction.
For both groups, administration lawyers kept reaching the same conclusion: Obama did not have legal standing to halt their deportations.
White House advisers raised the idea of another delay when it became clear that unveiling the executive actions in the aftermath of sweeping Republican victories might be ugly. But one official said the prospect of Republican anger was preferable to backlash from Hispanics if Obama blinked again, and the idea was quickly dropped.
Three days after the election, Obama invited congressional leaders from both parties to the White House to deliver that message over lunch. Administration officials said Boehner made one more attempt to stop Obama, suggesting that he might be able to get House vote by the spring. A GOP aide disputed that Boehner outlined a specific timeline.
As the president delivered his speech live to the nation Thursday night, pro-immigration demonstrators outside the White House gates draped American flags over themselves, parading signs in bold type: "Gracias, Presidente Obama." His speechwriter, Cody Keenan, slipped out of his tie and into the crowd unnoticed, hoping to savor the moment.
Associated Press writers Erica Werner, Jim Kuhnhenn and Alicia A. Caldwell contributed to this report.
Reach Julie Pace on Twitter at http://twitter.com/jpaceDC and Josh Lederman at http://twitter.com/joshledermanAP