Unpopular and unpredictable, President Trump is emerging as a problem for the British prime minister, Boris Johnson, in his election campaign.

Credit...Matt Dunham/Associated Press

LONDON — Prime Minister Boris Johnson of Britain spoke with President Trump by phone on Tuesday, and to judge by the dueling summaries of the call provided by the White House and 10 Downing Street, Mr. Johnson and Mr. Trump were involved in two completely different conversations.

The White House said the two leaders pledged to negotiate “a robust bilateral free trade agreement once the United Kingdom leaves the European Union.” Downing Street said nothing about a deal, noting instead that Mr. Johnson urged Mr. Trump to lift American tariffs on Scotch whisky.

Such divergent accounts of a leader-to-leader call are not unheard-of, but the timing of this one, on the eve of Britain’s general election campaign, was telling. It shows just how much of a liability Mr. Trump has become for Mr. Johnson. Once, the prime minister talked up the benefits of having a close friend in the White House; now he is distancing himself from a figure who is radioactive to many Britons.

Mr. Trump was only one of a multitude of headaches for Mr. Johnson on Wednesday, as he kicked off his campaign in an election that will serve as a referendum on his Brexit policy — and was already shaping up as one of the most unpredictable, and consequential, of the post-World War II era in Britain.

While Mr. Johnson’s Conservative Party leads the opposition Labour Party in the polls, the prime minister was hit by the resignation of one of his cabinet ministers in a legal scandal, accusations that his party doctored a TV interview with a Labour leader and questions about why his government was delaying a report on Russian influence in British politics until after the Dec. 12 vote.

Trying to shrug off all the bad news, Mr. Johnson rallied supporters in the West Midlands with his message that only a vote for the Conservatives guarantees that Britain will leave the European Union.

Elsewhere in the Midlands, the Labour leader, Jeremy Corbyn, drove home his counter-message: that Mr. Johnson would sell out Britain’s state health system to a predatory Mr. Trump in a trade deal. “We’ll never let Donald Trump get his hands on our National Health Service,” he thundered.

Mr. Corbyn painted a dystopian picture of a Tory-led Britain that would mimic Mr. Trump’s America. “They’ll slash food standards to match the U.S.,” he said, referring darkly to rat hairs in paprika and maggots in orange juice, “and they’ll put chlorinated chicken on our supermarket shelves.”

Mr. Corbyn is hardly the first European politician to tap into anti-American sentiment to appeal to voters. But he has a rare opportunity with Mr. Trump, who has charted an unapologetically “America First” foreign policy and speaks effusively about his friendship with Mr. Johnson.

What makes Mr. Trump so dangerous for Mr. Johnson is his unpredictability — and his penchant for butting in. He called in to a London radio show last week with unsolicited advice for Mr. Johnson’s campaign, and Mr. Trump is expected in London for a meeting of NATO leaders in early December, just a few days before Britons go to the polls.

“Corbyn is trying to ensure that anything Trump says will be bad for Johnson — and history suggests he’s not great at shutting up,” said Anand Menon, a professor of politics at King’s College in London.

The Labour Party will do its best to surgically attach the two men over the next five weeks. On Tuesday, the party released a new advertisement showing Mr. Johnson in front of a blue bus emblazoned with a banner that said, “We’ll send Trump £500m a week. Let’s fund U.S. drug firms, not our N.H.S.”

The ad was a spoof on the infamous pro-Brexit campaign during the 2016 referendum in which Mr. Johnson posed in front of a red bus with the slogan, “We send the E.U. £350 million week. Let’s fund our N.H.S. instead.” The £350 million claim was spurious, but it helped fuel a narrow Brexit victory.

The £500 million claim, equivalent to nearly $650 million, is similarly dubious: It is hard to imagine any British government agreeing to a deal with the United States that would drive up prescription drug costs by that much. But in a country that reveres its National Health Service, for all its flaws, such appeals can resonate.

Mr. Corbyn suffered his own setback Wednesday when the Labour Party’s deputy, Tom Watson, abruptly resigned and said he would not run for his seat in Parliament. A leader of the party’s dwindling centrist faction, Mr. Watson’s exit will enable Mr. Corbyn to cement control over the party.

For Labour’s leftist leader, painting Mr. Trump as Mr. Johnson’s villainous friend is a reliable strategy in Britain, where demonstrators greeted the president during his last two visits with a giant balloon depicting him as a diaper-clad baby.

“Generally speaking, foreign leaders don’t play a role in British elections,” said Timothy Bale, a professor of politics at Queen Mary University in London. “But Donald Trump is so exceptional. We hear and see so much about him that he has almost become a presence in domestic British politics.”

Public attitudes toward Mr. Trump have not softened during his presidency. In a poll of Briton’s attitudes toward foreign leaders by the research group YouGov, only 19 percent of those surveyed said they had a positive opinion of Mr. Trump; 67 percent said they had a negative opinion, and 13 percent were neutral.

That places him behind George W. Bush and Pakistan’s president, Imran Khan, but ahead of President Emmanuel Macron of France and President Vladimir V. Putin of Russia. Former President Barack Obama remains by far the most popular foreign leader, with 73 percent of people saying they had a positive opinion of him.

As polarizing as Mr. Trump is, some skeptics said they doubted Labour would get much mileage out of making him an issue, given that voters ultimately decide based on things that matter to them personally.

“I don’t know how successful Corbyn will be in associating Boris with Trump — or even how damaging it would be to the Conservatives,” said Peter Westmacott, a former British ambassador to the United States. “Remember, Trump is still a good deal less unpopular in the U.K. than in other European countries, except perhaps Poland and Hungary.”

In Israel, where Mr. Trump remains very popular, Prime Minister Benjamin Netanyahu lashed himself to the president during his campaign and fared poorly, and Mr. Trump has since shown less affection for his erstwhile friend.

That fickleness was on display again last week, when he called in to a radio show hosted by the ardent pro-Brexit leader, Nigel Farage. Mr. Trump told him that the withdrawal deal Mr. Johnson negotiated with the European Union would preclude a trade agreement between Britain and the United States.

That struck a discordant note, in that Mr. Johnson has promoted his Brexit policy by saying it would open the door to a lucrative deal with Washington. Last weekend, he felt compelled to say in an interview that Mr. Trump was “patently in error.”

On that score, at least, the White House’s characterization of the Wednesday phone call could be seen as helping Mr. Johnson. It seemed to suggest that Mr. Trump was no longer troubled by his deal with Brussels and was looking forward to their future negotiations.

The fact that Mr. Johnson’s aides chose to ignore that, and play up his demand that Mr. Trump drop tariffs on British exports suggests they are focused more on voters in Scotland, as well as England’s north, where the Conservatives are targeting Labour loyalists who voted to leave the European Union.

Whether in the phone call or the Farage interview, Mr. Trump’s remarks have been tailor-made for Mr. Corbyn, who said recently that the president was interfering “to get his friend Boris Johnson elected.” The president’s comments did not sit well with Mr. Farage’s listeners either, who bombarded him with complaints that he should not have given Mr. Trump a platform.

“You were crying about how the Americans should not interfere in British political decisions,” said a listener from Essex who identified himself as Jason, “and yet, here you are sitting with him on your show.”

Several callers alluded to an episode in April 2016 when then-President Obama, on a visit to London, warned Britons that if they voted to leave the European Union, their country would be at the “back of the queue” for a trade deal with Washington. Mr. Obama’s remark, which came at the request of Prime Minister David Cameron, was widely judged to have backfired.

“Obama broke with precedent and it’s now open season on leaders commenting on other countries,” Mr. Farage said to his aggrieved listeners. “And it’s just how it seems to work, right or wrong.”