The British political landscape was transformed last night as an unbridled bidding war for power led to Gordon Brown proffering his resignation as prime minister in a dramatic attempt to secure Labour a power-sharing government with the Liberal Democrats.

Brown's surprise announcement on the steps of No 10 prompted an extraordinary Tory counter-offer to the Lib Dems: a referendum on the alternative vote electoral system, and a coalition government with seats for Nick Clegg's party in the cabinet. The proposed Tory coalition deal would last at least two parliamentary sessions.

The hurried Tory offer, previously seen as completely beyond the ideological pale for the party, was swallowed by shell-shocked Tory MPs.

Cameron said he would whip a vote in parliament to ensure there was a referendum on the alternative vote, but the Tories would then be free to campaign to keep first past the post in the referendum itself.

With events moving at breakneck speed, Clegg convened a second meeting of his party last night to decide if he should form what looks like a more stable coalition with the Conservatives, or risk an ideologically more comfortable deal with Labour and an as yet unnamed Labour leader. The Lib Dems continue to have concerns about the long-term viability of the latter coalition because key Commons votes would need support from minor parties to get them through. Without these parties a Lib-Lab coalition would still be 11 votes short of a Commons majority.

A deal with Labour, which is certain to be branded as a coalition of losers by the rightwing press, would need the support of smaller parties to command a Commons majority, as well as of Labour MPs on the left of the party, who are opposed to big spending cuts to bring the country's £168bn deficit down.

Clegg had said privately he intended to use his unprecedented moment holding the balance of power single-mindedly to achieve electoral reform, but even he could not have expected the other parties to go to such lengths to win his support.

In an act of political guile, Clegg negotiated with both parties in secret, not telling the other what he was doing in a bid to maximise his strength. While the talks with the Tories were ongoing and announced, parallel secret discussions with a Labour team were taking place.

In one of the most frenetic days in British politics, the focus had initially been entirely on talks to reach a coalition agreement between the Conservatives and Liberal Democrats. William Hague, the shadow foreign secretary, met senior Liberal Democrats in the morning, after seven hours of talks on Sunday, giving the impression that a deal was imminent. Hague declared that the talks had been positive, but later in the afternoon David Laws, the Lib Dem education spokesman, gave the first public hints that the Tory offer fell short of what was required.

The Tories said as part of a deal they had agreed to the Lib Dem position that they would ensure that no one earning less than £10,000 should pay income tax, a commitment that would cost £17bn. In return the Lib Dems had agreed that the deficit should start to be cut this year, a change in the party's previous view that cuts this year would undermine the recovery.

Later, Brown transformed the delicate party negotiations with his shock announcement that he would give up the Labour leadership by September, with a leadership election lasting through the summer. Speaking at 5pm, he said: "The reason that we have a hung parliament is that no single party and no single leader was able to win the full support of the country. As leader of my party I must accept that as a judgment on me. I therefore intend to ask the Labour party to set in train the processes needed for its own leadership election … I will play no part in that contest. I will back no individual candidate."

Sources said Brown had recognised halfway through the election campaign that he would resign as Labour leader, but at the weekend agreed to bring forward the statement to yesterday in a bid to open the way for a Lib-Lab deal.

His resignation statement was first drafted with the Labour leader on Saturday by Lord Mandelson, Lord Adonis and Alastair Campbell before discussions were held with Clegg. In subsequent meetings with Clegg, Brown said his position as PM would not be an issue, but did not spell out what he meant.

Mandelson said last night: "We don't know if it will work, but if it does Gordon will have succeeded in ushering in the most dramatic development in postwar British politics."

Labour made it clear to Lib Dems that it would be willing to introduce legislation that would lay the groundwork for the alternative vote system, which could then be introduced immediately after a positive referendum result.

The party was encouraged to make its daring move after indications that senior Lib Dems, including Lord Ashdown, Lord Steel, Charles Kennedy, Sir Menzies Campbell, Vince Cable and David Laws, felt ideologically more sympathetic to Labour.

The justice secretary, Jack Straw, is understood to have argued that Labour should go into opposition and accept the result.

The former home secretary, John Reid, also claimed that the possibility of a Lib-Lab coalition represented mutually assured destruction for both parties. Labour also cannot rely on its MPs to support voting reform in Commons votes.

Brown's resignation announcement jolted a Conservative high command that thought it had a monopoly on contacts with the Lib Dems, and was largely unaware that Clegg had been holding back-channel talks with Labour. Clegg updated Lib Dem MPs last night on the initial formal talks with Labour and sources said a final decision would be deferred until today. A Lib Dem source said last night: "Tomorrow is crunch time."

At the conclusion of a two-hour meeting of Lib Dem MPs and peers, a party spokesman said the party endorsed Clegg's strategy and that negotiations needed to be concluded rapidly. The spokesman said: "Negotiations will resume later today and there will be a further meeting of the parliamentary party during the day."

It is expected that Ed Balls, the children's secretary, Ed Miliband, the energy secretary, and David Miliband, the foreign secretary, will be among those competing for the leadership in a contest that has to last a minimum of seven weeks. They have all agreed to keep silent until the talks with the Lib Dems reach a conclusion. Harriet Harman said she would remain as Labour's deputy leader and would not stand for leader or back any contestant.

Hague said it would be a "great mistake" for the Lib Dems to link up with Labour, given their "apparent attachment to improving democracy".

Michael Gove, the shadow schools secretary, said: "Our aim has been to present the Liberal Democrats with a very clear choice.A strong, stable government with a clear majority capable of making the right decisions in the national interest versus an unstable government comprised of a variety of parties that cannot take those decisions. An elected prime minister who the public has seen put through his paces in the leadership debates, versus a second unelected prime minister.

"It is for them to decide. It is their choice. This is our offer, they can decide."

Tory offer to Lib Dems

• Referendum on alternative vote for elections to Commons

• Cabinet seats and other ministerial jobs for Lib Dems

• Agreement on schools, environment and possibly taxation

Labour offer to Lib Dems

• Guaranteed alternative vote for elections to Commons

• Possible future referendum on "full PR" of single transferable vote

• Full coalition with cabinet seats

• Broad agreement on deficit reduction

• New leadership for Labour once binding deal with Lib Dems agreed"