Gordon Brown announced this evening he was resigning as prime minister with immediate effect.

Mr Brown addressed the media outside Downing Street at 7.20pm with wife Sarah by his side.

He thanked her, his two sons and his staff in his speech.

Mr Brown said: “I wish the next prime minister well as he makes the important choices for the future. Only those who have held the office of prime minister can understand the full weight of its responsibilities and its great capacity for good.

“I have been privileged to learn much about the very best in human nature and a fair amount too about its frailties – including my own.”

He finished his address with “thanks – and goodbye”.

He then left with Sarah for the short drive to Buckingham Palace after allowing his young sons to be photographed for the first time.

Mr Brown tendered his resignation to the Queen, who accepted it.

She is then expected to appoint Conservative Party leader David Cameron as prime minister.

Reports said Mr Brown was expected to stand down as MP for Kirkcaldy and Cowdenbeath but sources now say he will remain in the position.

Harriet Harman, who until today was the minister for equality has become acting leader of the Labour Party.

Just after he finished speaking, shadow foreign secretary William Hague emerged from talks with Liberal Democrat negotiators.

He would not be drawn on what, if any, agreements had been made and it remains unclear whether a coalition government or a Conservative minority government will be formed.