LONDON—U.K. Prime Minister David Cameron joined forces on the European Union referendum campaign Monday with the new mayor of London from the opposition Labour Party, a man he suggested last month had consorted with Islamist extremists.

The unusual alliance comes as Mr. Cameron faces pressure from within his Conservative Party ahead of the June 23 vote on EU membership. He has been criticized for his management of the pro-EU push. A Conservative critic has said he could face a leadership challenge after the vote.

The developments highlight how the referendum is cutting across traditional party allegiances in Britain, with Mr. Cameron forging alliances with some political foes while battling a sizable element within his own party who are leading the campaign for Britain to withdraw from the bloc.

At the joint event in southwest London, Mr. Cameron and London Mayor Sadiq Khan—who was elected this month—said that while they disagreed on many issues they were united in their belief that the U.K. should stay in the EU.

During the run-up to the London mayoral election Mr. Cameron questioned Mr. Khan's judgment and said he had shared a platform with a preacher who supported the Islamic State radical militant group.

At the time, Mr. Khan rejected the criticism, saying he had fought extremism all his life and the prime minister was joining in a divisive campaign against him by his Conservative opponent for the mayoralty.

On Monday, Mr. Cameron congratulated Mr. Khan on his election victory and hailed him as a "proud Muslim, a proud Brit and a proud Londoner" and said he was proud to be with the Labour mayor as part of an "incredibly broad campaign" for EU membership.

Mr. Khan said that more than half a million jobs in London were dependent on the U.K.'s membership in the EU and that a vote for "remain" meant jobs and opportunities. Remaining would also help fight diseases and climate change, protect workers' rights and ensure stronger U.K. defense, Mr. Khan said.

This isn't the first time the prime minister has put aside political differences during the EU campaign.

Last month, he joined forces with former union boss Brendan Barber to say that EU membership was vital for jobs and wages in the U.K. as part of his focus on the economic argument for staying in the bloc.

The prime minister's efforts to reach across the political divide have contrasted with increasingly rancorous infighting among Conservatives over the EU that has raised questions about party unity and Mr. Cameron's leadership after the referendum.

The campaign in favor of leaving has been driven by several leading Conservatives, among them Boris Johnson, Mr. Khan's predecessor as London mayor, and a handful of cabinet ministers including the prime minister's friend, Justice Minister Michael Gove.

On Sunday, Conservative lawmaker Andrew Bridgen, who has criticized the prime minister on other issues before, told the British Broadcasting Corp. that the party was so fractured over the EU issue that it had effectively lost its small parliamentary majority and a new election was needed.

He said at least 50 Conservative lawmakers were dissatisfied with the prime minister's leadership of the "remain" campaign and it was highly likely they would challenge Mr. Cameron's leadership of the party.

Mr. Bridgen couldn't be reached to comment.

Euroskeptic Conservative lawmakers have voiced anger at the way Mr. Cameron has deployed the government machinery to campaign for staying in the EU, such as using taxpayers' money to fund a postal campaign to every household in the country explaining its arguments for membership of the bloc.

The Conservative lawmakers have also accused the government of trying to scare Britons into voting for EU membership by saying that leaving the EU, or "Brexit," would cause a recession.

In response, Mr. Cameron has said it is the government's official position that the U.K. should stay in the EU and he has said he will not apologize for laying out what he believes are the risks of leaving the bloc.

Write to Nicholas Winning at nick.winning@wsj.com

 

(END) Dow Jones Newswires

May 30, 2016 20:45 ET (00:45 GMT)

Copyright (c) 2016 Dow Jones & Company, Inc.