Image caption Lord Mandelson was a party to the negotiations after the general election

Liberal Democrat leader Nick Clegg told Gordon Brown he had to leave office as the price of any coalition deal with Labour, it has emerged.

The revelation, from former Business Secretary Lord Mandelson, comes in the Times' serialisation of his memoirs.

He says Mr Clegg told Mr Brown it was "not possible to secure the legitimacy of a coalition" unless he stood down as prime minister in "a dignified way".

The story has been confirmed by Mr Clegg's spokeswoman.

Lord Mandelson was with Mr Brown in the negotiations that took place in the days after the general election in May.

He describes a secret meeting at which the now deputy prime minister told the PM to his face he would have to go, if there was to be any hope of a Lib Dem-Labour coalition deal.

Analysis Political memoirs are a bit like visits from the in laws. They're viewed with dread and apprehension by those on the receiving end but are just something you have to go through. So predictably Peter Mandelson's memoirs have provoked a good deal of anguish in Labour circles even though their political impact may be relatively muted. Why? Well, there surely is little more we need or want to know about the Blair/Brown wars. And in a funny way the tales of those years of infighting and seething resentment could actually benefit Labour by enabling the various leadership candidates to define themselves against. Hence Andy Burnham's promise yesterday that there would be no return to the "egotistical factionalism" of those years. Far from opening old wounds, these memoirs may actually help Labour to emerge from the shadow of the Blair/Brown years. Daily View: Mandelson memoirs

Mr Clegg is quoted as saying: "Please understand I have no personal animosity whatsoever... but it is not possible to secure the legitimacy of a coalition and win a referendum unless you move on in a dignified way."

Lord Mandelson says Mr Brown did not give a clear answer at the time, but soon afterwards left Downing Street to inform the Queen he was quitting.

A spokeswoman for the deputy PM told the BBC: "Nick Clegg did feel that given the general election result, it would be incomprehensible to the British people if Gordon Brown remained as prime minister and he did make that clear to him."

Lord Mandelson claims Mr Brown went as far as drawing up a proposed Lib-Lab cabinet featuring Mr Clegg, Vince Cable and Lord Ashdown.

But he says former prime minister Tony Blair also told his successor he could not be part of any coalition.

"Tony told him and me that the public would simply not accept Gordon remaining," he writes.

He adds that Mr Brown eventually accepted he would have to quit, but did not want it to look like he had been forced out.

Lord Mandelson quotes him as saying: "I have been humiliated enough."

'Egotistical factionalism'

Lord Mandelson's memoirs have already proved controversial.

Ahead of the publication of his book, The Third Man, the peer told the Times Mr Brown believed that the two of them, and Tony Blair, had "killed each other" with their internal feuding.

Lord Mandelson also claimed that allies of Mr Brown showed "unbridled contempt" for Mr Blair which was "very destructive".

Tony told him and me that the public would simply not accept Gordon remaining Lord Mandelson Burnham blasts Labour 'plotting'

Mr Brown's former aide, Charlie Whelan, hit back at the allegations, but Labour leadership hopeful Andy Burnham told the BBC on Sunday that infighting and plotting had damaged the party.

The former health secretary said he wanted to offer a "complete break" from "egotistical factionalism" at the top of Labour.

Elsewhere on Monday, Mr Clegg and Prime Minister David Cameron have given a show of unity by writing a joint newspaper article proclaiming their coalition is about shared principles of giving more power to people.