Since he resigned after the European Union referendum, there have been accusations levelled at David Cameron from all sides of the Brexit debate. For Remainers, his calling the referendum in the first place, seen mostly as an attempt to ease internal party tensions, was an unforgiveable gamble. For Leavers, his direction to the civil service forbidding preparations for leaving the EU was contemptible.

Still discussed, but far less widely, is the parlous state in which he left UK-EU relations. Many of the difficulties Theresa May has been up against in the Brexit talks stem in part from Cameron’s tenure and the personal damage he did to trust and goodwill.

By the time the European Council came to draft their negotiating guidelines, the UK was a counterpart to be suspicious of and seen as a potentially highly disruptive force that needed to be treated with short shrift.

Three examples are illustrative.

First, in his Conservative leadership bid in 2005, Cameron promised to pull the party out of the EPP—the main centre-right political grouping in the European parliament. This was thought to be a relatively cost-free promise that would appease Conservatives on Cameron’s right.

But it was a miscalculation. The decision alienated him from key EU allies on the centre-right, including Angela Merkel and Nicolas Sarkozy (as well as Jean-Claude Juncker), some of whom would play a central role in his attempted renegotiation. Cameron unnecessarily burned political capital for little perceptible domestic gain.

Further damage was done by Cameron’s pledge in the 2015 Conservative manifesto to bring forward a British Bill of Rights to replace the Human Rights Act and “break the formal link between British courts and the European Court of Human Rights.” Ostensibly, this was not an anti-EU move given the ECHR is not an EU body. However, it is an important placeholder for shared rights commitments in the EU.

At the very least, this pledge—undoubtedly supported by Theresa May as Home Secretary—raised suspicions in the EU about the UK’s human rights commitments. This has had a direct impact in the Brexit talks.

The Commission’s recent negotiating slides on internal security propose on any future security treaty that “if the UK leaves the Convention or is condemned by the European Court of Human Rights (ECHR)” the agreement would be voided, effectively attempting to bind the UK into the ECHR in future.

Finally, there was Cameron’s renegotiation. This process was not part of a long-term strategy to improve EU governance to make UK membership more palatable. Rather, it was a short-term response to having to deliver a referendum on EU membership after unexpectedly winning a parliamentary majority. And it is for these reasons that it failed to deliver what Cameron promised.

First, there was timing. Just as EU members were beginning to clamber out of the economic malaise of multiple crises, and as the migration crisis was gaining salience, Cameron threw an unwanted spanner into the works.

What is more, he attempted to force a debate on internal migration on other EU members, for whom the main concern was, and still is, external migration, not free movement within the EU. He also pursued a strategy, which Theresa May has dutifully followed, of appealing directly to member states for help, and to Merkel in particular, over the head of the Commission. Being generous, all this was seen as uncollegiate.

This points to three lessons that the UK is still yet to learn. First, influence from outside the EU structures bears no comparison to that from within. This should have informed the government’s tactics. After the disruptive behaviour of the Cameron years, there is far from an endless supply of goodwill for the UK to draw upon and it should temper its ambitions accordingly.

Secondly, domestic policy and messaging do not exist in a vacuum. What appeared to be a predominantly domestic UK debate about human rights legislation has translated into suspicion and distrust. Despite what many British politicians believe, the UK and EU are not entirely separate political spheres and what happens in one often overlaps into the other.

Thirdly, the attempted renegotiation ought to have been a chastening experience. For the UK’s concerns to gain meaningful traction required them to be tied in with wider EU priorities, alongside proposals that simultaneously helped a broad group of member states, not just the UK. The UK’s demands in the Brexit talks bear a similar, one-sided resemblance.

All this, of course, is not to absolve Theresa May of her own errors. Her decision to trigger Article 50 when she did, particularly in light of the government’s lack of preparedness, has left the UK appearing disjointed and amateurish.

Even now, almost a year and half since Article 50 was triggered, the civil service is running just to stand still. Along with Cameron’s legacy, this has all but eradicated the EU27’s confidence in the UK as a reliable partner, limiting the concessions it can responsibly offer.

These talks could have gone differently, and the UK could have had more success than it has. The shame is that May is not only living with Cameron’s mistakes but repeating them.

By Matt Bevington, policy researcher at The UK in a Changing Europe. This piece originally featured in Prospect.