At David Cameron’s final Prime Minister’s Questions, a Labour MP asked him how his plan to get the Tories to ‘stop banging on about Europe’ was going. The chamber erupted in laughter and Cameron gave a rather sheepish response. Afterwards, one of those who had prepared Cameron for PMQs wondered whether he should have given a more robust answer. Surely, he argued, the party would stop banging on about Europe now that the referendum had settled the question.

How naive that seems in retrospect. It is now becoming clear that the referendum only succeeded in ushering in the most bitter battle in the Tories’ 40-year civil war over Europe. Even a few months ago there was still optimism that once Brexit day arrived, the Tories could pick a new leader free of EU baggage and reunite. Theresa May’s deal has crushed that hope.

The Prime Minister is backing a deal that locks her party in conflict and agony by guaranteeing that two of its most cherished principles — sovereignty and the union — will be in constant friction with each other. The so-called ‘backstop’ makes it clear that Northern Ireland will obey EU single market rules — unless Brussels can be persuaded to endorse another way of keeping the Irish border open. This means that the UK, too, must play by EU rules – or break from Northern Ireland, giving teeth to a regulatory border in the Irish Sea. So May’s deal leaves the UK grappling with a choice between having control of its own rules and regulations, and preserving the economic integrity of the kingdom.

The Tory party had a brief preview of this argument back in December, when the joint report first came out. With the DUP objecting, Theresa May didn’t initially sign up to it. In those few days, cabinet ministers privately debated what to do. One — who may well succeed Theresa May — was clear that he’d choose Great Britain having the economic benefits of Brexit even if it meant Northern Ireland being given special status.

More Tories think like this than you might imagine. The Margaret Thatcher view that Northern Ireland is as British as Finchley is no longer as dominant as it once was. But a willingness to let Northern Ireland’s status evolve in this manner is still, for the moment, a minority view. There’s also now a group of Tories who are Unionists first and Conservatives second: the party’s Scottish contingent. This used to be a one-man band, but not anymore. There are now 13 Scottish Tory MPs, and the Scottish party makes up 15 per cent of the overall party membership: nowadays, Scots are almost twice as likely as the English to be Tory members.

This powerful bloc would resist anything they thought would bolster the case for either a second Scottish independence referendum or the eventual breakup of the United Kingdom. But the EU has made it clear that the Irish border can only be kept open if Northern Ireland remains in alignment with a host of EU rules. So the Tory party will be left having to constantly choose between the UK taking back control of its own rules and regulations, or loosening links with Northern Ireland. This will fast become one of the new faultlines in Tory politics, and it has the potential to split the party.

This is just part of the toxic legacy that May will leave. Her party’s Euroscepticism has historically been driven by an interest in reclaiming control over laws governing the economy. But her Brexit plan can claim only one big, clear win: it will end free movement once the transition period is over. Even under the backstop, EU nationals will have no automatic right to settle in Britain. Those close to Theresa May argue that she will have delivered on the biggest single reason that people voted for Brexit. They say that the next biggest reason was money and that her plan will see payments to Brussels falling from £10 billion a year to well under £1 billion.

But a Brexit that is concerned almost solely with these subjects does nothing for those who want to break free from the protectionism of the customs union. It doesn’t allow the UK to move away from EU environmental rules that are too often not based on proper scientific evidence. It means the UK must accept all of the EU’s existing social legislation — so this deal doesn’t even restore us to the position we were in after the Maastricht treaty, when the country at least had an opt-out from the social chapter. We shall have to wait to see what the final EU/UK trade deal stipulates. But the common rulebook approach that May advocates would also see the EU’s precautionary principle continue to hinder scientific research and technological innovation.

The third problem that Theresa May will leave behind her is a lack of trust. In the aftermath of the referendum, she won the leadership because she was acceptable to all sides. During the referendum, May had positioned herself rather cleverly (or, her critics would say, cynically) as a reluctant Remainer. She never sounded like a great enthusiast for the EU, gave a speech setting out her position that contained many caveats, and in the last ten days of the campaign said that she still wanted more on free movement. This positioning meant that she was acceptable to all sides when the leadership campaign came. Brexiteers believed that she really did mean that ‘Brexit means Brexit’, while Remainers thought she understood their concerns.

But May’s premiership has eroded that trust. Brexiteers argue, with justification, that May has approached the whole thing as a damage limitation exercise rather than as an opportunity to be seized. As one cabinet minister acknowledges, the decision to put unity ahead of sectarianism and entrust a Remainer with the project has proved disastrous. This will make them determined to pick a Brexiteer as the next leader.

It could well be that May changed tack and abandoned her ‘clean Brexit’ plan when she lost her party’s majority. Perhaps she decided then that the new parliamentary arithmetic meant that it would not, after all, be possible to decisively take back control. But if this is her logic, she never explicitly said so. This failure to explain her strategy has contributed to the general sense of mistrust and betrayal that is roiling the Tory party at the moment.

So if another Remainer wins the leadership next time round, then the chances of a Tory split will increase. Already, some of the figures most involved with Vote Leave are discussing the possibility of a new party. At the same time, if the next Tory leadership election comes before Brexit day and is won by someone who views ‘no deal’ as the least bad option, there will be a breakaway led by the Remain wing of the party. It is worth remembering that Amber Rudd has already said that she’d prefer a second referendum to no deal; and two ministers at last week’s cabinet said that they’d vote against no deal in the Commons if it came to it.

This trust problem could be compounded if May’s deal is passed on the back of votes from Labour MPs — whether because they agree with it, or because they think that backing her deal means signing the Tories’ death warrant. As things stand, she will lose the vote without significant Labour support. The DUP’s ten MPs will vote against, joining two simultaneous Tory rebellions: one by those who don’t think it is a proper Brexit, and another by those who want a second referendum. The government therefore needs to find a load of votes somewhere.

If May softens her deal further to win over more opposition MPs, the sense of betrayal will be even more acute. You can already hear Brexiteer Tories gearing up to denounce May as their very own Ramsay MacDonald if she does a deal with Labour to get this through. (No. 10 are denying rumours that May will accept an amendment making the UK’s membership of a customs union with the EU permanent rather than temporary).

Up to now, Tories have consoled themselves with the thought that the mood is not as bad as it was during the Maastricht debates of 1993 — the fallout from which helped to keep the Tories out of power for 13 years. They point out that personal relations are more civil than they were then. But that has changed in the past few days. ‘I judge my success these days by how many of my colleagues I can get howling at the moon by the end of the day,’ one minister told me last week.

This rancour will take a long time to dissipate: the Tories will always remember who stood where. It will be extremely difficult for anyone to emerge as a unity candidate to succeed Theresa May, with support from right across the party.

So is a Tory defeat and some kind of split inevitable? Well, there is one figure who might prevent it: Jeremy Corbyn. If Labour were led by a middle-of-the-road figure, there would be little to deter the Tories from indulging in blue-on-blue action; the favoured pastime of many of them. But most Tory MPs remain aware that a Corbyn government would be different from your typical Labour government; that even if it only lasted for one term it would leave an indelible mark on the country. For this reason, there is a reluctance to bring the house down.

In the 1990s, many Tories felt that the party was tired and would benefit from a spell in opposition. After 18 years in government that had transformed the country, touching nearly every aspect of national life, the party was out of ideas. At the same time, the New Labour leadership was a backhanded tribute to the Tories, a recognition that the changes they had made were now settled policy. But today’s Tory party has only been in power for eight years, and five of those were spent in coalition. The majority of the Tory party has been elected in the last nine years, and this group has yet to produce a prime minister. And no one can see Jeremy Corbyn as any kind of tribute to the Tories. Indeed, he would threaten the Thatcher settlement Tony Blair accepted.

Sometimes good prime ministers are bad party leaders. May has failed in both roles. Her missteps in the negotiations have left the UK having to choose between a set of unpalatable Brexit options, while as Tory leader she called a needless election in which she lost her majority. But perhaps her most serious offence is that she has exacerbated divisions over Europe, both in her party and the country, and ensured that they will carry on for another generation.