Nick Clegg turned full circle on Tuesday and said that he might work with Gordon Brown in a hung parliament, as new polls suggested Labour could win the most seats in next week’s election.

The Liberal Democrat leader said he would not have a problem working with Mr Brown, having previously said it was “preposterous” for the prime minister to continue in Number 10 if he came third in the popular vote.

Mr Brown’s future has become the subject of increased speculation in Labour circles, amid signs that David Miliband, foreign secretary, has emerged as the “modernisers’” choice if the prime minister resigns or is forced to stand down.

The prime minister’s allies said Mr Brown could win the election and that speculation that he would stand down was “bonkers”. One said: “We’ve got 30 per cent of people saying they’re undecided so there's all to play for.”

Even Mr Brown’s critics admit a putsch against him is unlikely so long as he remains prime minister. In a hung parliament, striking a deal with Mr Clegg could keep him in Number 10 and keep his Labour enemies at bay.

The Liberal Democrat leader is treading a tortuous path, trying to keep open his options of playing Mr Brown off against David Cameron, the Conservative leader, both of whom could face leadership challenges if they took their party into opposition.

Polls on Wednesday put the Tories ahead but leave Mr Cameron short of an overall majority.

Mr Brown’s allies said it would be highly undemocratic for any Labour MPs to try to remove him while he was still trying to put together a government: his prerogative in a hung ­parliament.

“How could you turn around to the electorate – who have just seen Brown, Cameron and Clegg in television debates – and say we’re going to choose a prime minister who is none of the above,” said one.

Mr Brown’s Labour critics are waiting to see the outcome of the poll, knowing that any sign of disloyalty would be severely punished by Labour activists.

However, it is understood that David Miliband is now seen by Lord Mandelson, Labour campaign chief, as the strongest candidate should Mr Brown stand down.

Alan Johnson, home secretary, has said Mr Miliband is “an immense talent” but has not ruled out standing himself. Meanwhile Alistair Darling, the chancellor, is another admirer of the foreign secretary.

Harriet Harman, deputy leader, has said she would not want Mr Brown’s job, but Labour modernisers think she could fly the standard of the party’s left if Ed Balls, schools secretary, were to lose his seat.

Doubts about the decision-making skills of Ed Miliband, climate change secretary and brother of David, have percolated through Whitehall, al-though his supporters insist the claims are not borne out by his ministerial record.

Mr Balls faces a fight to defend his seat but would be backed by many trade union leaders who see him as the best hope for the Labour left.

“The idea of Lord Mandelson, an unelected peer, sticking one of the new Labour youth wing into the leadership won’t happen without a fight,” said one trade union official.

The schools secretary said on Tuesday he was not the statist of popular view. “During my time at the Treasury I was always at the front of the modernisation debate. I’m as New Labour as they come.”

Copyright The Financial Times Limited 2018. All rights reserved.

Comments have not been enabled for this article.