Fabian Picardo, Gibraltar's chief minister, warned a few weeks ago that there would be a period of "peaks and troughs" ahead before the withdrawal agreement between the UK and EU over Brexit was sealed. This week his words have proven to be almost prophetic; in fact, the term 'rollercoaster' almost seems more apt.
There was positive news very recently when Spanish prime minister Pedro Sánchez announced that Gibraltar was not going to be a problem in the negotiations because agreement had been reached over the Gibraltar Protocol which has to be attached to the UK/EU withdrawal agreement.
The Gibraltar government, which has been negotiating Brexit directly with Spain and with the UK, also explained that work was continuing on several Memoranda of Understanding and these had almost been agreed, but pointed out that, in any case, they are separate from the withdrawal agreement and neither depended on the other.
Meanwhile, Theresa May appeared to have backing for the UK's withdrawal agreement, and it was expected to be ratified at a special European Council meeting on Sunday.
Spanish foreign minister Josep Borrell said earlier this week, however, that Spain wanted the wording to be changed, because it was not happy about Article 184. This states that "the EU and the United Kingdom shall make every effort, in good faith and with full respect for their respective legal systems, to adopt the measures necessary to negotiate rapidly the agreements governing their future relationship."
Claiming that this had been sneaked into the text by EU negotiators without Spain's knowledge, Borrell insisted that "future negotiations on Gibraltar are separate negotiations" and demanded that the text be amended to specify that Gibraltar's future relationship with the EU be decided bilaterally between the UK and Spain, similar to Clause 24 in the EU negotiating guidelines.
The UK government replied that it would not exclude Gibraltar from negotiations on the final relationship, whereupon Pedro Sánchez said that unless the withdrawal agreement and political declaration included the clause, he would not ratify them.
In itself, this is not that important for the UK or Gibraltar. The draft withdrawal agreement does not need unanimous approval, just a simple majority in the EU Parliament and 20 out of 27 member states, representing 65 per cent of the population of EU27, in the European Council. However, other EU states were also indicating that there were things in the agreement that they were not happy with either.
On Wednesday evening Theresa May said she had spoken with the Spanish prime minister and was confident that by Sunday a deal could be reached that delivered for "the whole UK family including Gibraltar".
On Thursday it was announced that the political declaration, which gives a rough outline of how UK-EU trade, security and other issues will work after Brexit, had been "agreed in principle". It is not legally binding. However, it does not mention Gibraltar and it appears that the draft withdrawal agreement has not been changed as Spain had requested.
In Gibraltar, the chief minister seemed equally confident. Addressing parliament on Thursday afternoon he explained that the Memoranda of Understanding had now been finalised subject to last-minute legal checks, and said that "desite the threats, Gibraltar will be part of any withdrawal agreement and transitional arrangement if there is one".
So now, it is really down to Theresa May. She returns to Brussels on Saturday for further talks with EU Commission president Jean Claude Juncker, and if the European Council ratifies the deal and political declaration on Sunday she has to try to persuade British MPs to back it. If they do, which is not at all certain, it goes to the European Parliament to be ratified, and the UK and Gibraltar leave the EU on 29 March next year, and start negotiating over the future. If not, watch this space.