ONDON — Jeremy Corbyn never budged. Not even Barack Obama could have convinced the Labour leader to help David Cameron make the case against Brexit.

Less than a month before the historic EU referendum, the team assembled by Cameron to keep Britain in the European Union was worried about wavering Labour voters and frustrated by the opposition leader’s lukewarm support. Remain campaign operatives floated a plan to convince Corbyn to make a public gesture of cross-party unity by appearing in public with the prime minister. Polling showed this would be the “number one” play to reach Labour voters.

Senior staff from the campaign “begged” Corbyn to do a rally with the prime minister, according to a senior source who was close to the Remain campaign. Corbyn wanted nothing to do with the Tory leader, no matter what was at stake. Gordon Brown, the Labour prime minister whom Cameron vanquished in 2010, was sent to plead with Corbyn to change his mind. Corbyn wouldn’t. Senior figures in the Remain camp, who included Cameron’s trusted communications chief Craig Oliver and Jim Messina, President Obama’s campaign guru, were furious.

Even at more basic levels of campaigning, Labour were refusing to cooperate. The party would not share its voter registration lists with Stronger In, fearing the Tories would steal the information for the next general election. “Our data is our data,” one senior Labour source said when asked about the allegation.

In desperation, the Remain strategists discussed reaching out to the White House to intervene directly. Obama had met Corbyn during a trip to London in April, when the American president argued forcefully for Remain. They wondered: Maybe Obama could call the Labour leader and convince him to campaign with Cameron?

Don’t bother, Labour aides told them. Nobody was going to coax their boss into sharing a public platform with Cameron. The idea was dropped before it reached the White House.

“We can’t stand there every week and wail away at you for prime minister’s questions and then get on stage with you,” a senior Corbyn aide said at one tense meeting three weeks before the vote, according to a Remain source.

By that point in the campaign, Cameron’s team was starting to panic. Their once-comfortable polling lead, at one time around 10 percentage points, was falling. The tide seemed to turn. Remain had built its case around a sober message centered on the economic risks of a so-called Brexit from the EU. Suddenly in the final month of the race, the message was drowned out by a rancorous argument over migration.

The failed courtship of Corbyn was one of a number of problems Cameron’s seasoned political team faced, culminating in Thursday’s stunning referendum defeat and the prime minister’s early retirement from public life.

More than two dozen interviews conducted over a span of months with the leaders of the Stronger In and Vote Leave campaigns, senior Downing Street officials and sources in the Conservative and Labour parties paint a picture of a Remain effort that misread the public mood and couldn't overcome numerous campaign setbacks.

Hardened by close-run contests in the 2014 Scottish independence referendum and last year’s general election, the strategists running Stronger In decided to follow the playbook that worked in those campaigns, particularly the 2015 Conservative sweep, and focus mainly on economic security.

It failed spectacularly. The depth of public anger over the influx of workers from other EU countries, and more broadly the rejection of political and business elites, was more significant than they had anticipated.

The In campaign’s warnings about the economic damage of an Out didn’t stick. A series of elaborate set pieces, of which Obama’s visit was the most extravagant, didn’t resonate with the British electorate.

Prominent defections from the Cameron inner circle to the Leave side — chiefly Boris Johnson and Michael Gove — turned Vote Leave from a ragtag group into a motivated and effective opposition. The press, as expected, was hostile and Euroskeptic. By the end Cameron appeared isolated, as Tory MPs bickered among themselves — and Corbyn kept his distance.

BRUSSELS DEAL ‘FLOPPED’

ltimately, Cameron only has himself to blame.

Back in January 2013, the prime minister committed to an In-Out referendum on Britain’s membership in the EU. He chose to make this pledge to try to unite his Conservatives, see off a challenge from the rising populist party UKIP and put Labour, unwilling to countenance a vote on the EU, on the back foot.

When Cameron triumphed in last year’s parliamentary election, becoming the first Conservative leader in 23 years to win a majority in the House of Commons, he was boxed in on Europe. He had promised voters to strike a new deal with Brussels on the British terms of membership and hold a vote before the end of 2017.

Cameron found a chilly reception across the Channel to his demands. EU leaders such as Germany’s Angela Merkel wanted to help him make the case to stay in the EU. But they were also distracted by the unprecedentedly large waves of migrants flooding into the Continent and the aftershocks of the Greek debt crisis. The other 27 EU countries were reluctant to create different rules for the U.K. In particular Merkel shot down Cameron’s efforts to carve out a British exception to the EU’s freedom of citizens to work and live anywhere in the bloc.

The prime minister decided to compromise. His advisers were eager to get a deal with Brussels and hold a referendum sooner than later. Delay would in their view carry higher risks. Another year of negative stories about the Continent “would absolutely destroy” his chances of winning a vote, he was told by senior figures in the Remain effort.

As Brussels held its ground, Cameron dropped his manifesto commitment for new EU workers to wait four years before accessing benefits, as long as something was done to cut immigration. In February Britain and the EU struck a deal. Britain would get an “emergency brake,” allowing the U.K. to withhold access to benefits for new migrants for a one-off period of seven years.

“I don’t think we ever thought this was going to be the golden chalice,” a Cameron adviser said, referring to the Obama visit in April.

Cameron thought it was a good deal under the circumstances, one of his advisers said. But the British pressed panned it roundly (“Call that a deal, Dave?” the Daily Mail raged on its front page) and the Out campaigners accused him of a sellout.

“It flopped, but it was sort of impossible to meet expectations,” the adviser close to Number 10 said. “[Cameron] thought he got a good deal, but for people who cared about the deal there was no deal that was ever going to be good enough.”

Downing Street had no choice but to sell it anyway. Hours after Cameron returned from Brussels, the Remain campaign unleashed a media blitz that would set the tone of the next four months.

‘PROJECT FEAR’

he Stronger In campaign was led by Oliver, the former BBC editor who ran Cameron’s communications team, and Will Straw, a highly-regarded Labour policy expert and son of Jack Straw, a former Labour foreign minister.

They set up in an open-plan office space in London’s financial district, with room for about 50 people. Joining Oliver and Straw were Ryan Coetzee and James McGrory, a couple of battle-hardened former aides for the Liberal Democrats, and a host of junior Labour special advisers.

It was an all-star lineup of Westminster insiders. They worked long hours: Senior staff started each day with a 6:15 a.m. conference call and ended it with another at 10:20 p.m. to agree the talking points for the morning news programs.

Oliver had worked closely with Lynton Crosby, the blunt-talking Australian campaign guru, on the Conservatives 2015 general election. On the mantelpiece of his spacious wood-panelled office in Downing Street sits a framed picture of the front page of the Sun the day after that unexpectedly strong victory, showing a smiling, waving Cameron next to the headline, “BLUEDINI.” (Blue being the Tory color.)

With Crosby deciding not to get involved in this campaign, Cameron turned to his driven, cool-headed communications adviser to sell the case for staying. In the final weeks of the campaign, Oliver spent four-fifths of his time at Stronger In. At one point, according to a person familiar with his thinking, he planned to resign and move over entirely to the campaign, and be reemployed by the government later. He stayed with Number 10 for part of his time so he could attend meetings there.

“He was believable, he was passionate, he gave everyone who was watching it a very clear message," said a Leave official, referring to Boris Johnson.

Crosby may have been on the sidelines but the campaign followed his recipe: focus relentlessly on a few no-nonsense messages that resonate with people’s everyday experiences. In last year's general election, the Conservatives mercilessly played on doubts about then-Labour leader Ed Miliband’s suitability as prime minister, concerns about Labour’s record on the economy, and nervousness about the Scottish National Party potentially taking power in a coalition with Miliband.

This time, Remain would focus on the economy, underline the risks of leaving, and try to win the argument early. They wanted to pin the Leave side to fighting on immigration, where they thought it would come off as negative, xenophobic, and divisive.

“What we wanted to do early on was own the economy, own business, and own the fact that you’ll be better off [by voting to stay],” a senior campaign source said. “We wanted to own that very early. And I think that was successful, because that sort of pegged them back to another kind of campaign, which is essentially the [UKIP leader Nigel] Farage campaign. Which is very, very focused on immigration, very, very focused on isolating Britain from the world. Now, that is a powerful argument and has its impact, but it’s not what I think the people who were originally running Vote Leave wanted.”

By the time Cameron fired the starting gun, the Remainers had honed their pitch to a couple of simple messages: Britain would be “stronger, safer and better off” in the EU, and leaving would be a “leap in the dark.” Both tested well with focus groups.

Following Crosby’s instructions that “you can never fatten a pig on market day,” the campaign moved to make their case from the get-go, bombarding the TV and radio airwaves, newspapers and social media. Cameron was front and center. Often accused of complacency, or “chillaxing,” the prime minister wasn’t going to lose this fight because he wasn’t trying; Cameron “worked his arse off” to make the case, one prominent Labour figure who worked closely with the Remain campaign said.

Cameron even drafted in Obama to help. The U.S. president’s warnings not to leave failed to move the polls. His intervention in April encouraged more young people to register to vote, but Obama’s blunt remark that Britain would be “at the back of a queue” for a trade deal with America if it left the union irritated many U.K. voters.

“I don’t think we ever thought this was going to be the golden chalice,” one senior source close to the Downing Street operation said, but admitted the campaign operatives were disappointed that Obama didn’t give them a bump.

ET TU, BORIS?

hen on February 21 came Boris Johnson’s “betrayal,” as Cameron’s closest aides described it, of his old schoolmate from Oxford and Eton days.

The decision by the former mayor of London, now the leading contender for Cameron’s job, to put his weight behind the Leave campaign was among the most significant moments in the campaign, one senior source close to Number 10 said.

The most popular politician in the U.K., a genuine celebrity, Johnson traveled tirelessly around the country in a red bus, where his enthusiasm and personality “single-handedly transformed what was an oddball group of pretty unattractive people” into a mainstream force, a former senior Conservative adviser said.

He was “indispensable” to the Leave campaign, a Leave campaign source said.

Johnson’s closing speech in a BBC TV debate, two nights before Thursday's vote, in which he declared June 23 Britain’s “Independence Day,” was one of Leave’s strongest moments in the campaign, the source said. “I truly believe that that may have been one of the most significant reasons why we went over the top last night,” the Leave source said on Friday.

“He was believable, he was passionate, he gave everyone who was watching it a very clear message: Here’s why you should vote for us,” the Leave insider said. “Then there was inspiration at the end. Those are all the critical components to motivating a voter to go to the polls to vote for you.”

In contrast, he said, the politicians on the Remain side were “dark, they made it personal, they didn’t make it about the people of Britain and I think that hurt them tremendously.”

For Cameron, Johnson’s entry into the race was a personal betrayal that cut deeply.

“There is huge frustration and a feeling of betrayal with Boris that feels very personal for Cameron,” a source close to the prime minister said. Until the day of the result, the pair, who used to text each other regularly, had not spoken in months.

Cameron may have seen it coming: “Boris will do whatever gets Boris the most attention,” he told Downing Street aides before his rival’s declaration. Cameron was “gleeful” when a newspaper article Johnson wrote about President Obama, labeling him “part Kenyan,” stirred controversy, according to the person close to the campaign.

Cameron lost another political ally and close personal friend to the other side: Michael Gove, the justice secretary. Gove was godfather to Cameron’s late son Ivan; their wives were friends and their children play buddies.

“[Cameron] had been led to believe Michael was onside,” one former Downing Street aide said.

Instead, Gove had joined the charge for Brexit two days before Johnson, after months of agonizing between his loyalty to the prime minister and his fiercely Euroskeptic convictions. He and Johnson made a strong combination.

MESSAGE FAILURE

n a rancorous battle of assertions and slogans, Cameron’s pitch of “stronger, safer, and better off” proved to be less memorable than Vote Leave’s “Take back control.”

Number 10 had underestimated the depths of public anger about Cameron’s broken promises on controlling the flow of people from the Continent. They didn’t have a convincing argument to counter it.

They were “surprised and impressed” by how well Vote Leave exploited the public’s dissatisfaction with the large number of EU citizens who had come to live and work in Britain, one senior source said.

“I can’t believe people are really going to vote themselves poorer because they don’t like the Poles living next door.”

The beginning of “purdah,” the four-week period when civil servants and government departments were barred from political campaigning, meant Remain lost the home-field advantage of having government departments issuing reports and communications supporting its case. A run of live television events gave Vote Leave’s figureheads equal airtime in front of millions of viewers.

Leave’s main talking points, including assertions that Turkey was on the brink of joining in the EU and that Britain “sends” £350 million a week to Brussels, were hotly disputed, but gained traction with voters. At the same time, only one in five of those surveyed in April believed Remain’s assertion that British households would be on average £4,300 worse off after leaving the union.

Leave began aggressively pushing on migration. They got a huge boost in late May when the Office for National Statistics revealed that net migration in 2015 had hit 333,000, the second highest figure on record. Cameron’s 2010 promise to reduce the figure to the “tens of thousands” had come back to haunt him, at the worst possible moment. Migration was now central to the debate, but it was winning Leave support, not isolating them.

It wasn’t just the focus on migration that led to the surge in support, a Leave campaign source said. They sought to turn voters’ concerns about it into a positive pitch: If you take back control from Brussels, you can end free movement across borders and relieve the pressure on hospitals and schools. The aim was to reassure voters it was OK to back Brexit. Their politicians were well-drilled, and stuck to the script. In one hour-long TV appearance Gove used the phrase “take back control” 23 times.

Remain failed to “make the case that life for people in Britain was going to be better remaining in the EU,” said a Leave campaign insider. “They just made the case that leaving would be bad. There’s a big difference between those two things.”

The Cameron-led campaign spent too much time on the defensive, the Leave insider said Friday. Its attempts to rebut the Brexiteers £350 million a week complaint underlined in many voters’ minds that Britain’s contribution to Brussels was sizeable. “The problem with that is that if I’m a voter sitting at home watching that debate, I’m still saying, ‘You know what, I don’t care if it’s £350 million or £170 million, there’s still a heck of a lot of money going to the EU to pay for things that I don’t want to pay for.’”

Stronger In watched in frustration as Leave rose in the polls. “They said they wouldn’t, but their whole fucking campaign has been based on immigration,” one staffer said.

They didn’t think the bounce for Vote Leave would last. “I can’t believe people are really going to vote themselves poorer because they don’t like the Poles living next door,” one former Cameron adviser said at the height of the Brexit surge.

Yet in the second week of June, Leave was ahead in most published polls.

Number 10 were beginning to sweat. One weekend at the height of the Brexit surge in June, Downing Street staff gathered at a wedding. The mood was bleak.

“People who you wouldn’t expect to be thinking like that were worried,” one former aide said.

“There was a freak out when the Leave campaign surged,” one source close to the campaign added.

LABOUR BASE GOES FOR LEAVE

athered in Stronger In’s campaign war room, some senior staff argued that they needed to “switch the conversation” away from warnings over the economy. Downing Street put its foot down: They’d been here before. Ignore the polls and the pundits, they reassured their colleagues. Our strategy is the right one. Momentum will swing back to the status quo. Hold your nerve.

But they needed Labour to step up. Internal polling found just weeks before June 23 one in five Labour voters did not know the party’s position in the referendum. As party aides canvassed voters around the country, they discovered a deep well of concern about immigration.

The base that returned the prime minister to office just a year ago was never going to be enough on its own. To avoid an exit, and save David Cameron’s job and political legacy, Remain needed to reach beyond these voters and sway older, white English voters, many of whom in the past voted Labour. The campaign found that many of them were unwilling to rally behind a prime minister they didn’t like, didn’t vote for, and whose policies had left them worse off.

Other prominent Labour politicians, including former prime ministers Tony Blair and Gordon Brown, were willing to campaign with the Tories, but Corbyn refused to help his rival. It was widely believed that, although he agreed to publicly endorse a Remain vote that his heart wasn’t in it.

An old school socialist, the Labour leader had in the past attacked the EU as an undemocratic, corporatist conspiracy that threatened workers’ rights. He never looked the part to save Cameron in a referendum the Conservative leader brought on himself.

Corbyn believed that Labour’s willingness to help Cameron save the union during the Scottish independence campaign in 2014 had contributed to the party’s electoral wipeout north of the border a year later at the general election, according to a person familiar with their discussions.

The Labour leader defiantly campaigned on his own — half-heartedly and ineffectively, senior figures in the Remain campaign said. (On Thursday, Labour's traditional heartlands in northern England and Wales turned strongly against the EU.)

A SHOCKING KILLING

he only moment in the campaign when Corbyn agreed to stand near the Prime Minister was at a tribute to the Labour MP Jo Cox, the day after her assassination on June 16. It was only then that Number 10 “accidentally” got the picture they needed of Cameron and Corbyn together, a senior campaign source said.

Straw, the director of Stronger In and a close friend of Cox, had been deeply affected by the killing. On the day of the attack, he announced her murder to the staff at the campaign’s headquarters in London’s financial district. Those who were there said it was “a very emotional moment for everyone.”

The killing stopped the campaign in its tracks, when Brexit appeared to be gaining momentum in the polls. Some believed Cox’s killing would change the course of the entire referendum. Yet while shocking, the shooting appears to have had little impact on the final result.

After a 48-hour break in hostilities, campaigning resumed on Sunday. With only days to go, polls suggested Remain was back in front, if only just. The race seemed to be so close that campaign sources were prepared for everything from a narrow loss to a surprisingly comfortable win. Privately, insiders at Number 10 admitted they could lose.

At Remain’s base, they were quietly confident. Labour voters would “come home” and back the EU as the party’s leadership wanted, they said. On the last morning of the campaign, Tony Blair visited the campaign headquarters to give the staff a last-minute pep-talk. As the polls opened, they said they believed they were heading for a victory that would keep Britain in the union.

Within 24 hours, Cameron would announce his resignation.