The last post for Johnson... but will Balls deliver for Labour?

Ed Miliband's drive to revive the Labour Party's fortunes suffered a major setback last night with the surprise resignation of the Shadow Chancellor, Alan Johnson.

The former postman quit frontline politics for "deeply personal" reasons amid claims that his marriage had collapsed. It was reported that he resigned after discovering that his wife had had an affair with his personal police bodyguard while he was Home Secretary in the last Government.

Mr Miliband has performed a remarkable U-turn by appointing Ed Balls as Mr Johnson's successor as Shadow Chancellor. Mr Balls coveted the key Treasury brief but was rebuffed by the new Labour leader only three months ago when he chose Mr Johnson instead.

Mr Miliband, who wished Mr Johnson "all the best at this difficult time", must now try to forge a close working relationship with Mr Balls. His economic credentials are not in doubt but the two men, both former aides to Gordon Brown, have had tense relations since the "non-election" of 2007. Mr Balls was accused of blaming the fiasco on Mr Miliband and Douglas Alexander in the hope of escaping blame himself.

In his resignation letter, Mr Johnson told Mr Miliband: "I have decided to resign from the Shadow Cabinet for personal reasons to do with my family. I have found it difficult to cope with these issues in my private life whilst carrying out an important frontbench role."

Some Labour MPs expressed fears that Mr Miliband and Mr Balls would struggle to maintain a united front, reviving memories of the bitter personal rivalry between Mr Brown and Tony Blair. The Balls team will occupy the Commons office next to Mr Miliband.

However, there could be tensions over economic policy. Mr Miliband has stuck broadly to the last Labour government's plan to halve the deficit over four years. During the leadership election in which he was defeated by Mr Miliband, Mr Balls advocated a less drastic programme of cuts.

The Conservatives and Liberal Democrats were delighted at the elevation of Mr Balls, whom they dubbed a "deficit denier". They hope his association with Mr Brown will boost their campaign to pin responsibility for the public deficit and need for cuts on overspending by Labour, and scupper Mr Miliband's efforts to blame the global economic crisis.

Mr Balls, disappointed not to land the shadow Chancellor's post last October, has proved a success as an aggressive shadow Home Secretary. He will now take his bruising approach into battle against the Chancellor, George Osborne.

Mr Johnson stunned Westminster by leaving so quickly a job he intended to do for at least two years. He told Mr Miliband of his intention to resign eight days ago and the Labour leader failed to talk him out of it.

The Labour frontbencher Gerry Sutcliffe, a close Johnson ally, said: "Alan is a very private person and, if it is to do with his family – having known him for over 30 years – he will have made sure he puts his family first. Clearly it is a personal decision for him."

Mr Johnson joked that he needed an "economics primer" when appointed to the Treasury brief, made a series of gaffes in recent weeks. Some friends claimed he was unhappy in the role – and that he wanted more urgent action to tackle the deficit than Ed Miliband.

He was regarded as an effective communicator whose working-class background provided a useful antidote to the Cameron-Osborne duopoly. Blairites rued his departure, fearful that Brownites now dominate Labour's high command. Mr Johnson backed David Miliband for the Labour leadership and challenged Ed Miliband's line on a graduate tax and income tax before being dragged into line.

Mr Johnson, 60, whose first marriage ended in divorce in 1968, married his second wife Laura, now 47, in 1991. They have a 10-year-old son.

With his brother still unwilling to serve on the Labour front bench after his leadership election defeat, Ed Miliband was forced into a wide-ranging reshuffle. Yvette Cooper, who is married to Mr Balls, takes over his post as shadow Home Secretary. Her foreign affairs brief goes to Mr Alexander, whose Work and Pensions post is taken over by the Blairite Liam Byrne. His role shadowing the Cabinet Office is added to the responsibilities of Tessa Jowell, Labour's Olympics spokeswoman.

Mr Miliband, who held detailed talks with Mr Balls on Wednesday before deciding to appoint him, insisted that Labour's economic policy was "unchanged". He said: "Ed Balls is an outstanding economist and is hugely qualified to take our economic message to the country."

Mr Balls said of Mr Johnson: "I am sorry that he is having a tough time. He is a great loss."