I have taught and studied negotiation for almost 20 years. I have advised on scores of high-stakes negotiations, ranging from multibillion-dollar mergers to intractable conflicts between governments and armed insurgents. I have been in the room when seemingly impossible deals have materialized — and when promising deals have unraveled.

It’s not often that you can foretell success or failure clearly at the beginning of a negotiation process. But with Brexit, I could. The impasse at which Britain now finds itself — with an agreement that no one wants to support except under duress — was entirely predictable. Only weeks after the 2016 referendum, I wrote an article for the Harvard Business Review in which I reflected on the portfolio of false promises upon which the “Leave” campaigners had built their case:

Almost none of what was promised is actually possible — especially given the EU’s leverage and other constraints — which means the UK government will have to find a way to sell a lesser deal, or end up with no deal at all. But remember: Constraints can be a source of leverage. UK negotiators might be able to credibly say that they can’t possibly go back to their supporters with significantly less than what they promised on the eve of the referendum. In other words, the EU will need to make more concessions to avoid no deal. But the situation is a double-edged sword: The EU might come to the conclusion that since any deal is going to fall short of the extreme promises made in the UK, it is not worth giving any special concessions at all.

I hate to say it, but this is precisely where we are today.

Prime Minister Theresa May was not among the disingenuous Leave campaigners, but she made two significant mistakes early on as prime minister: First, she focused too much on her own political problems and failed to take seriously the European Union’s legitimate fears and constraints. Ignoring the genuine “red lines” of your negotiation counterpart is often a costly mistake. Mrs. May’s second error was her refusal to manage expectations from the beginning. Instead of disassociating from the false promises of the “hard Brexit” crowd, she fueled its narrative, making it her own. Was this a naïve miscalculation regarding Britain’s actual bargaining power or a careful political calculation? It’s hard to say. Neither is easy to forgive. Either way, this fact-free narrative has left the British people unprepared to support the current deal and stumbling toward a disastrous “no deal” Brexit.

It may not be too late for the prime minister to rescue the negotiation process. But to do so, she must first stop negotiating like an agent and start negotiating like a mediator.

There are situations in which we expect agents representing each side to go head to head, trying to get the best possible deal for their respective sides. (Think, for example, of any deal-making where there is a pile of money on the table, waiting to be split.) But then there are negotiations that are so constrained or complex that the parties are lucky if there is even one deal that everyone can live with. (For example, an international climate deal, the Israeli-Palestinian peace process or attempts to resolve the conflict in Syria.) In this type of negotiation, you can’t just walk in with a list of demands for the other side. Instead, you must take on the mantle of a mediator and push all sides to make difficult but necessary concessions to avoid disaster.