Washington (CNN) It was late July and nerves at the White House were high. Sen. Chuck Schumer, the New York Democrat, was widely expected to announce his opposition to the Iran deal -- and dozens of other House and Senate Democrats were threatening to revolt against the nuclear agreement and deliver President Barack Obama a devastating blow on the international stage.

But weeks before it would become public, the White House won a critical assurance that would dramatically change the outlook in Congress: Sen. Harry Reid would support it.

In a private call, the Senate Democratic leader secretly assured Secretary of State John Kerry that he would back the deal, though he would keep quiet about it publicly, Democratic sources said. He promised to help deliver critical information about which Democrats to target -- but Reid himself needed to let about a dozen friends, supporters and donors who were sharply critical of the deal know why he was backing it before his position became public.

What ensued was perhaps the most aggressive and coordinated lobbying drive ever to take shape between congressional Democratic leaders and the Obama White House -- which have frequently been at odds over strategy and tactics. It was a strategy that focused exclusively on House and Senate Democrats, ignoring Republicans altogether. And it underscored how sensitive the deal was to a number of Democrats, who feared a sharp backlash from pro-Israel voters and their Republican foes.

The Democrats succeeded largely because the lobbying effort to back the deal was far more targeted and relentless than the public push and advertising campaigns aimed at scuttling it, according to lawmakers in both parties. For a president often criticized for being detached from Congress, Obama aggressively used his bully pulpit to win over his party, contacting 125 Democratic House members and senators since July, many of them repeatedly, according to Democratic sources.

Tennessee Sen. Bob Corker, the GOP chairman of the Senate Foreign Relations Committee and an opponent of the deal, said his Democratic friends reported to him that the White House was "breaking arms and legs" to prevent Congress from voting down the deal. And it worked, culminating in a Thursday victory where Senate Democrats filibustered a resolution to reject the deal and House Democrats secured enough support to sustain a veto, handing Obama the most far-reaching international achievement of his presidency.

To quell a Democratic uprising, the White House, Reid and House Minority Leader Nancy Pelosi traded key intelligence about uneasy Democrats, dispatching powerful Cabinet officials to lock down support. Over the August recess, Pelosi gave the White House 57 names of House Democrats who were wobbly on the Iran pact; Obama called all of them, including 30 calls to Democratic lawmakers in between rounds of golf during his Martha's Vineyard vacation, according to Democratic sources.

Senate Minority Whip Dick Durbin called almost everyone in his 46-member caucus, interrupting a family vacation in Oregon to lobby skittish Democrats. On a jaunt to Florida last week where he talked about his presidential ambitions, Vice President Joe Biden made a side trip to help woo and eventually win over Florida Rep. Debbie Wasserman Schultz, an influential Jewish Democrat who was facing fierce protests, including from some activists who charged that she should "go to the oven," a reference to the Holocaust.

Senior administration officials made 250 calls to House members and senators, sources said. That includes Jack Lew, the Treasury secretary and an Orthodox Jew, who was dispatched in part to help alleviate concerns of Jewish lawmakers, and Kerry, a former senator who relied on his longstanding Hill connections to push his party to back the deal.

Yet it was Ernest Moniz, the Department of Energy secretary and a nuclear physicist, who became the most prolific and effective surrogate, lawmakers said.

Moniz headed to the Detroit area to win over Michigan Sen. Gary Peters this summer. After pro-Israel forces were ratcheting up oppositpion in Montana, Moniz laid out his views to a local newspaper to help ensure Sen. Jon Tester didn't defect. And he called into a North Dakota radio show to help give political cover to Heidi Heitkamp, the state's centrist Democratic senator.

Moniz was so influential that the final Democrat who announced her support -- Washington Sen. Maria Cantwell -- waited to return to Washington to meet with him to let him reassure her about the capability of inspectors to continue to detect nuclear activity in the country. He told them all that the deal cut off Iran's pathways to building a nuclear bomb.

Reid later privately mused about the possibility of nominating Moniz for the Nobel Peace Prize, according to an aide familiar with the matter.

Numbers in Obama's favor

What helped Obama and supporters was the fact that the congressional review law only required the White House to prevent a veto-proof, two-thirds majority from forming in each chamber. With 46 Senate Democrats and 188 House Democrats, that meant limiting defections to fewer than 13 in the Senate and 42 in the House. On Thursday, just four Democrats voted to break a filibuster in the Senate on a motion to disapprove of the Iran deal, keeping the accord alive, with Pelosi's office announcing it had enough support to sustain a potential veto.

Given the more progressive bent in the House Democratic Caucus, the White House always viewed the House as its firewall -- and spent ample resources and time to ensure that the dam didn't break.

Soon after the deal was announced in July, Pelosi announced her backing and worked furiously with the White House to keep Democrats in line. Through August, aides said, Pelosi was on the phone during trips across the country, including in Napa Valley, California, and New Orleans at an event recognizing the 10-year anniversary of Hurricane Katrina, speaking to every member of her caucus -- including some repeatedly.

JUST WATCHED Trump, Cruz and Palin slam Iran nuclear deal Replay More Videos ... MUST WATCH Trump, Cruz and Palin slam Iran nuclear deal 05:37

Democrats still raised major concerns -- namely over how Iranian nuclear sites could be inspected, how other countries would react if the U.S. walked away from the deal and whether rolling back sanctions against Iran would empower the country and threaten Israel.

When questions were raised, relevant Cabinet members would try to iron out those concerns. And when the pressure from the President was needed, he would intensify his lobbying.

Pelosi said Thursday that Obama knew the agreement so well he could teach a "masters class" on the topic.

She relied heavily on the President and his team to deliver the key votes. Soon after the deal was announced, Biden traveled to the House Democratic Caucus to lobby his party behind it, followed by visits from Moniz and Kerry. Then the White House focused heavily on small groups, dispatching Wendy Sherman, an under secretary of state, to brief the Congressional Black Caucus in late July.

Right before the August recess, with fears that angry town hall meetings in members' home states could shift the debate, Obama spent more than two hours in the White House's Blue Room with two dozen House Democrats, answering questions from skeptical members. In a meeting with 12 House Democrats in late July who were leaning against the plan, Obama convinced half of them to support it, aides said.

"This agreement is not perfect," Pelosi said Thursday. "But I never have seen a perfect anything."

The Senate strategy

Despite losing the support of Schumer, an influential Jewish Democrat who represents a staunchly pro-Israel constituency in New York, Democrats in the Senate were not too concerned it would have a broader impact. Schumer promised not to lobby Democrats to oppose the deal -- and Democratic leaders took full advantage of that.

As Reid and senior White House aides were coordinating on strategy, Durbin was calling members of his caucus on his family trip to Oregon in August.

"Wherever we are, we have to do our work -- and he was on the phone with me and others the entire time," Reid said Thursday as Durbin stood next to him.

Throughout the recess, a number of Democrats who supported the deal ended up meeting with fierce opponents in order to explain their line of thinking.

Sen. Bill Nelson, a Florida Democrat, ended up meeting with Ron Dermer, Israel's ambassador to the United States, in Miami. He talked with officials from the powerful pro-Israel lobbying group the American Israel Public Affairs Committee, including Holocaust survivors.

"It was one of the most respectful, friendly meetings," Nelson said.

Some resisted the White House's help in order to show their independence from a President whom senators said often expressed how important the deal was to him personally.

"I never talked to the President," said Sen. Claire McCaskill, a Missouri Democrat. "I got one call from (national security adviser) Susan Rice. I told them, 'I don't want any calls from the administration, so leave me alone.'"

McCaskill said she eventually backed the deal after consulting with ambassadors of Asian countries over what they would do with Iranian money they were holding if the United States walked away from the agreement.

"Suffice it to say, I am for the agreement," she said.

Others received attention from the President, among them Peters, the Michigan Democrat, and Colorado Sen. Michael Bennet, who faces a potentially tough re-election next year.

Peters, who traveled to the Middle East and discussed the nuclear deal with officials there, also co-hosted Moniz in the Detroit-era to answer questions from skeptical voters. He also spoke to Obama twice on the phone, in addition to an Oval Office meeting.

"I still have a lot of concerns," Peters said Wednesday, though he's backing the deal because he believes there are no better options.

Privately, Reid worked to ensure that Democrats would be prepared to filibuster the deal -- something that infuriated Republicans who wanted a straight-up-or-down vote so Obama would be forced to veto the resolution of disapproval. But at a private lunch Wednesday, Reid convinced his party to join in the filibuster, even as New Jersey Sen. Bob Menendez pushed back on that strategy.

Menendez demonstrated that Obama couldn't win over all of his party. Like Menendez and Schumer, Maryland Sen. Ben Cardin, the ranking Democrat on the Foreign Relations Committee, opposed the deal. And Sen. Joe Manchin of West Virginia, who rarely speaks to the President, announced his opposition after he heard strong criticism at town hall meetings in his state.

The evening before Manchin announced his opposition this week, the President called up the conservative Democrat to get him to flip. Manchin, at home on his boat parked at National Harbor in Maryland, wouldn't budge.

"He made his pitch, and I respect that," Manchin said. "I think he knew that I was in a different place."

"It's a no-brainer for him," he continued. "I said, 'Mr. President, I understand that.'"

In the end, it wouldn't matter. Republicans fell two senators shy Thursday of breaking a Democratic filibuster, which kept the Iran deal from even coming up for a vote.