Iain Duncan Smith has resigned from the Cabinet, citing the disability benefits cuts in the Budget.

The Work and Pensions Secretary has called the latest cuts "a compromise too far", and "distinctly political", rather than necessary for economic reasons.

The timing of the resignation is fascinating - just hours after the Treasury shelved plans, announced in the Budget, to cut the Personal Independence Payment. It also comes after Iain Duncan Smith, and other senior Tory Eurosceptics, expressed disquiet over David Cameron and George Osborne's tactics in the EU referendum campaign.

The resignation will deal a harsh blow to the chancellor's much-prized reputation for calculation and competence, as the work and pensions secretary suggests that Osborne is motivated by ideology over fairness. In his resignation letter, he suggests that the cuts to working-age families are unjust when compared to the "triple lock" on the state pension and the refusal to consider means-testing some pensioner benefits.

He told the prime minister: "You are aware that I believe the cuts would have been even fairer to younger families and people of working age if we had been willing to reduce some of the benefits given to better-off pensioners, but I have attempted to work within the constraints that you and the Chancellor set."

He says the cuts to the Personal Independence Payment were "not defensible in the way they were placed with a budget that benefits higher-earning taxpayers".

In a direct swipe at George Osborne, his resignation letter ends: "I hope as the government goes forward you can look again, however, at the balance of cuts you have insisted on, and wondered if enough has been done to ensure we 'are all in this together'."

The resignation is particularly surprising given that, just hours earlier, the Treasury shelved the proposed cuts to PIP - following threats of a Tory backbench rebellion.

As the chancellor delivered his speech on Wednesday, former Labour minister Yvette Cooper was one of the first to spot that the biggest revenue raiser was the £4bn taken from PIP (personal independence payments). These are intended to help disabled people with daily life - tasks such as washing, dressing and taking medicine. There is another component which helps with mobility.

Throughout Thursday, it was notable that Conservative MPs were reluctant to tour the broadcasters to defend the decision. On Question Time, education minister Nicky Morgan suggested the cut to PIP was merely a "suggestion".

Three Tory MPs - including mayoral candidate Zac Goldsmith - were also asked to resign as patrons of disability charities over their support for welfare cuts.

The last straw seems to have been a threatened backbench rebellion, an alarming prospect for a government with a majority of just 12. Labour and the SNP had already indicated they would oppose the PIP changes.

Osborne has long seen the welfare budget as a source of significant savings, but this is hampered by the fact that the majority of its departmental spending goes on pensions, which are ringfenced.

But previous cuts have been accompanied by endless paragraphs about the country's dire economic prospects, the deficit and the need to make savings. Instead, Wednesday's Budget was characterised by giveaways in other areas - cuts to corporation tax, and an 8pt fall in capital gains tax, for example. The threshold at which employees begin to pay the higher 40p tax rate was also lifted by the largest amount since the 1980s.

In such circumstances, even loyal Tories were finding it difficult to defend taking money away from the disabled - particularly since many of those who receive PIP are in work, and in fact some rely on it to stay in work.

The big question of the night now is the chronology - did Iain Duncan Smith know the Treasury planned to dump blame for the U-turn on him? (The Treasury briefing earlier said the PIP cuts were "not an integral part of the Budget - it's a DWP package that came out beforehand".) Did he assume that he was for the chop after the EU referendum and decide to go now in a blaze of principled glory? And how dangerous will he be on the backbenches over the next 100 days?

Read Iain Duncan Smith's resignation letter in full:

I am incredibly proud of the welfare reforms that the Government has delivered over the last five years. Those reforms have helped to generate record rates of employment and in particular a substantial reduction in workless households.

As you know, the advancement of social justice was my driving reason for becoming part of your ministerial team and I continue to be grateful to you for giving me the opportunity to serve. You have appointed good colleagues to my department who I have enjoyed working with. It has been a particular privilege to work with with excellent civil servants and the outstanding Lord Freud and other ministers including my present team, throughout all of my time at the Department of Work and Pensions.

I truly believe that we have made changes that will greatly improve the life chances of the most disadvantaged people in this country and increase their opportunities to thrive. A nation's commitment to the least advantaged should include the provision of a generous safety net but it should also include incentive structures and practical assistance programmes to help them live independently of the state. Together, we've made enormous strides towards building a system of social security that gets the balance right between state-help and self-help.

Throughout these years, because of the perilous public finances we inherited from the last Labour administration, difficult cuts have been necessary. I have found some of these cuts easier to justify than others but aware of the economic situation and determined to be a team player I have accepted their necessity.

You are aware that I believe the cuts would have been even fairer to younger families and people of working age if we had been willing to reduce some of the benefits given to better-off pensioners but I have attempted to work within the constraints that you and the Chancellor set.

I have for some time and rather reluctantly come to believe that the latest changes to benefits to the disabled and the context in which they've been made are a compromise too far. While they are defensible in narrow terms, given the continuing deficit, they are not defensible in the way they were placed within a Budget that benefits higher earning taxpayers. They should have instead been part of a wider process to engage others in finding the best way to better focus resources on those most in need.

I am unable to watch passively whilst certain policies are enacted in order to meet the fiscal self-imposed restraints that I believe are more and more perceived as distinctly political rather than in the national economic interest. Too often my team and I have been pressured in the immediate run up to a budget or fiscal event to deliver yet more reductions to the working age benefit bill. There has been too much emphasis on money saving exercises and not enough awareness from the Treasury, in particular, that the government's vision of a new welfare-to-work system could not be repeatedly salami-sliced.

It is therefore with enormous regret that I have decided to resign. You should be very proud of what this government has done on deficit reduction, corporate competitiveness, education reforms and devolution of power. I hope as the government goes forward you can look again, however, at the balance of the cuts you have insisted upon and wonder if enough has been done to ensure "we are all in this together".