Britain’s recent election produced plenty of memorable images—from UKIP leader Nigel Farage hoisting pints of beer to 20-year-old Scottish National Party candidate Mhairi Black delivering a victory speech beside her defeated 47-year-old Labour Party rival. But arguably the most iconic involved a bacon sandwich. As the journalist Michael Weiss joked on Twitter after the vote, “This is the worst massacre in history ever perpetrated by a bacon sandwich.”

That massacre involved the Conservative Party (or Tories) defying predictions of a tight race and wresting enough seats from Labour to win a majority in Parliament. Labour was also driven from its former stronghold of Scotland. The party’s leader, Ed Miliband, has resigned.

Labour suffered its worst performance in almost three decades for many reasons, including a surge of nationalism in Scotland, Labour’s failure to articulate a winning economic vision, and Miliband’s struggle to connect with voters. But the Labour leader was also battling throughout the campaign against his own image—an image of a geek, an oddball, an outsider. And much of the credit for that image goes to the British press.

The country’s rowdy tabloids have always jockeyed to influence elections; the famous catchphrase “It’s The Sun Wot Won It” refers to The Sun’s front-page claim to singlehandedly clobbering Labour with barrels of unkind ink in the 1992 election. But they outdid themselves in conspicuous displays of partisanship in this year’s contest, with most major papers backing the Tories. In contrast to the United States, where newspapers typically consign political endorsements to the editorial pages, British news outlets are often vociferous in declaring their allegiances and, even more often, in condemning their political opponents (whether these pronouncements actually shape electoral outcomes is a matter of fierce debate). Just before last week’s election, for example, the Conservative-aligned Daily Mail blared on its front page, “For sanity’s sake, don’t let a class-war zealot and the SNP destroy our economy—and our very nation,” in reference to Miliband and the Scottish National Party.

Which brings us back to that bacon sandwich. The day before the election, the Conservative-allied Sun published a front page that encapsulated—or at the very least escalated—these intensely personal attacks on Miliband:

It’s a cover that requires some decoding. The Sun was trotting out a now-infamous photograph from 2014 of Miliband struggling to eat a bacon sandwich (or “sarnie” or “butty”), which spawned Internet memes and even led Miliband to suggest that those who wanted a prime minister who looked good eating a bacon sandwich should vote for “the other guy” (that other guy, Conservative Prime Minister David Cameron, later attracted his own foodborne scandal by eating a hot dog with a fork and knife). Bacon sandwiches—and by bacon, I mean thick-cut English bacon, not the crispy American variety—are a popular breakfast food in Britain, and sometimes identified as working-class fare. The bacon-sandwich test is administered to candidates to prove their Average Joe status—the British equivalent of “Who would you rather have a beer with?” And many in the press, including headline writers at The Sun, felt Miliband failed that test spectacularly. The pork puns on The Sun’s front page strengthen the blow: “Porkies” is another word for “lies,” and making a “pig’s ear” of something is synonymous with making a mess. (Some have detected a hint of anti-Semitism in the cover, since pork isn’t kosher and Miliband is Jewish, though it’s unclear if the tabloid intended anything of the sort.) The woman on Miliband’s right shoulder is SNP leader Nicola Sturgeon.

The bacon-sandwich critique is only the beginning. After defeating his brother David for leadership of the Labour Party, Miliband was frequently referred to as a “backstabber” for committing political fratricide. The media hounded Miliband for this sin throughout the campaign; in one Q&A session with the politician, journalist Jeremy Paxman said, “A lot of people, when they look at your candidacy … they look at you and think, ‘What a shame it’s not his brother.’” Even Miliband’s late father was used as a weapon against him. In 2013, the Daily Mail referred to Ralph Miliband, a prominent Marxist intellectual, as “the man who hated Britain.” Miliband was most often criticized for being just plain weird. He was called a “North London geek” and told that he resembles Wallace from the British claymation comedy Wallace and Gromit. In 2012, journalist John Humphreys mused about whether Miliband was “too ugly” to be prime minister. These lines of attack by old media were well-tailored for new media. A Twitter account, “Odd Miliband,” sprouted to document Miliband’s awkwardness. Clips of Miliband trying to look normal took off on YouTube.

Poking fun at the appearances of candidates is nothing new (picture Michael Dukakis on the tank), but the relentless campaign of demonization against Miliband has alarmed some, particularly since it appears to have been waged in part by right-wing press barons angered by Miliband’s proposal to eliminate tax loopholes for the wealthy and his aggressive stance on the recent phone-hacking scandal involving Rupert Murdoch’s News International (News International owns The Sun, among other news outlets).

“If we lived in a rational, mature democracy that wasn’t dominated by shamelessly self-interested private interests running the ‘free media,’ we would be able to debate [campaign policy] issues sensibly. Sadly, we do not,” columnist Owen Jones wrote in The Guardian in April. “These attacks are sinister. Miliband is being portrayed as not just lacking loyalty to his own nation, but being actively hostile to it. … Political debate is being consistently demeaned and poisoned by right-wing politicians and media outlets.”

If their campaign works, Jones continued, “it will be vindication of such a strategy in political debate. It will be repeated time and time again, perhaps with ever-increasing intensity.”

In the final weeks of Britain’s election campaign, the meme machine began to work in Miliband’s favor. Teenage girls took to Twitter in support of the Labour leader under the hashtag #Milifandom, and The Sun’s cover produced a backlash in the form of another hashtag, #JeSuisEd, that celebrated awkward, ugly eating. Comedian Russell Brand endorsed Miliband on YouTube. But it wasn’t enough to save Ed on Election Day. The campaign against him just might have worked.